/*Problem 1: Provide SQL queries for the following questions */ -1 Schema creation -2 Table creation...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
/*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. /*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.
Expert Answer:
Answer rating: 100% (QA)
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... View the full answer
Related Book For
Fundamentals Of Database Systems
ISBN: 9780133970777
7th Edition
Authors: Ramez Elmasri, Shamkant Navathe
Posted Date:
Students also viewed these programming questions
-
Find the amount of interest earned by a deposit of $2450 for 6.5 years at 5.25% compounded quarterly. Suppose Susan Gorn invested $5000 in a savings account that paid quarterly interest. Aer 6 years...
-
At present, assuming a company focuses on maximizing shareholder wealth as its major goal. The managing director thinks this single goal is inappropriate and asks his co-directors for their views on...
-
Apple, a leading technilogy company, issues stocks to finance the development of one of its products. Profit growth in the first, second and third years is expected to be 6%, 8%, 10% annually,...
-
Find the derivative of the function. y = e x-4
-
The cosmic rays of highest energy are protons that have kinetic energy on the order of 1013 MeV. (a) How long would it take a proton of this energy to travel across the Milky Way galaxy, having a...
-
The blue color of the sky results from the scattering of sunlight by air molecules. The blue light has a frequency of about 7.5 1014 Hz. (a) Calculate the wavelength, in nm, associated with this...
-
What is the major drawback of analog-frequency analyzers?
-
In addition to a Gantt chart, youve drawn Brian a PERT diagram so that you can communicate the necessity to keep an eye on the critical path. Consult Figure which was derived from the data from...
-
Identify global industry value chain in the fashion retail industry. In what aspect, Zara is different from its competitors in value chain? Zara is famous for being fast. It takes Zara 6 weeks from...
-
Modern Kitchenware Co. specializes in the manufacturing and distribution of items used in the kitchen. Among its many products are microwave ovens, toasters, electric can openers, etc. Its home base...
-
Please 1,2,3 in java programing langauge 1. Java program to calculate the letter grades of students in a course and report those grades. Your program should first ask the user to enter the number of...
-
1. Outline the primary goal of a persuasive claim to get your audience to accept your point of view on immigration. 2. Must refute opposing arguments rather than just ignore them
-
The market for Brussels Sprouts in California is represented by the equations below. Q is measured in thousands of bushels. P = 9 Qd P = 2Qs PLEASE SHOW STEPS :) What is the equilibrium price and...
-
3. You are a corporate treasurer for Esso Oil. The quoted rate on dollar denominated euro commercial paper has just blipped down recently. Your firm can issue $10 million of 180-day euro commercial...
-
Evaluate the purchase of a new computer system based on the following information. The system will cost $175,000 It has a useful life of 8 years It will generate a saving of $25,000 per annum The...
-
A patient was complaining of fever, chills, cough and headache. His lips and fingernails turned grey. What diagnosis would you make? Name the two causal organisms and state the category to which...
-
Calculate the thresold KIE. t to produce from the seer -p+b + 1 pt b II-meson
-
Cobb Manufacturing Company uses a process cost system and average costing. The following production data is for the month of June 2011. Production Costs Work in process, beginning of the month:...
-
Specify queries a, b, c, e, f, i, and j of Exercise 8.16 in both tuple and domain relational calculus. Exercise 8.16 Specify the following queries on the COMPANY relational database schema shown in...
-
Discuss the general principles behind the C++ binding of the ODMG standard.
-
What are the different types of spatial data mining?
-
Fill in the blanks to make the following statements correct. a. The term quantity demanded refers to ___________ purchases by consumers, whereas quantity exchanged refers to ___________ purchases by...
-
The following diagram describes the hypothetical demand and supply for canned tuna in Canada in 2019. a. Suppose the price of a can of tuna is $4.00. What is the quantity demanded? What is the...
-
Fill in the blanks to make the following statements correct. a. The term quantity supplied refers to ___________ sales by producers, whereas quantity exchanged refers to ___________ sales by...
Study smarter with the SolutionInn App