Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/*Problem 1: Provide SQL queries for the following questions */ -1 Schema creation -2 Table creation --3 Insert records 4 /*Problem 2: Provide SQL
/*Problem 1: Provide SQL queries for the following questions */ -1 Schema creation -2 Table creation --3 Insert records 4 /*Problem 2: Provide SQL queries for the following questions */ --Table 1 Table creation and insert statements -- Table 2 : Table creation and sert statements /*Problem 3 Provide SQL queries for the following questions */ -1 Schema creation --2 Table creation --3: Insert records to the following questions. Use the .sql file template I provided in the attachment. You can open the .sql file directly in SQL server management server query editor. Problem 1: 3 points Write SQL script to perform the following actions. Your submission must include a .sql file with the following queries. To get full points, your script must execute without any errors, when I run the queries in SQL server. 1) Create a schema named "HAFH_Realty' 2) Create a table named 'Manager' in the schema HAFHRealty with 8 columns as given below. The data populated in each column is given in the column description beside its name. Identify suitable datatype for each column. Your table must have at least one char, varchar, date, int, decimal and bit datatypes. ManagerID (ID assigned by HAFHrealty when they join) ManagerFirstName (First name) ManagerLastName (Last name) ManagerBirthDate (BirthDate) WorkExperience Years (total work experience in years) ManagerSalary (ID assigned by HSAFHrealty when they join) CurrentEmployee (will have true or false values) 3) Write insert statements to insert 5 rows into the table *Manager' each with a different ManagerID. All columns in a row must have values. Problem 2: 4 points Write create statements to create the following two tables for "Good Reading" bookstore and insert 2 records in each table. Make sure you enforce the following and Choose the correct data types for the columns 1) Date columns need to be of type Date 2) Author numbers are 5-digit alphanumeric string, two letters and three numbers. 3) You want to minimize disk space requirements. Identify the columns that should be fixed length string types, and which should be variable length string types. 4)Tables must be created in the schema "Good Reading" Table 1: Write SQL queries to create table and insert 2 records PUBLISHER Publisher Name City Country Telephone YearFounded Table 2: Write SQL queries to create table and insert 2 records AUTHOR AuthorNumber AuthorName YearBorn Problem 3: 3 points 1) Write an SQL query to create a schema named "Organization" in your database 2) Write an SQL query to create a table named "Employee' in the schema named "Organization' The table must have 7 attributes namely Employee ID, EmployeeFirstName, EmployeeLastName EmployeePosition, EmployeeSalary, EmployeeDateHired, Employee Office Number Decide about the data types suitable for the columns Make sure that that the following constraints are included while creating the table Employee ID is the primary key. It is also an identity column where the values in this column start with 1000 and increment by 1 for every new employee entry. EmployeeFirstName and EmployeeLastName are not null columns The default value for EmployeePosition is 'Not Assigned EmployeeSalary should accept decimal values up to 4 decimals and this column should not accept salary less than 1500 dollars Employee Office Number is a unique column with default value as 000 3) Write insert statements to insert 5 rows into the table 'Employee' to insert data about 5 employees. You can make up the data by yourself.
Step by Step Solution
★★★★★
3.43 Rating (156 Votes )
There are 3 Steps involved in it
Step: 1
Based on the information provided in the images lets address each problem step by step Problem 1 1 Schema Creation sql CREATE SCHEMA HAFHRealty 2 Tabl...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started