Question: read carefully what is being asked and create an SQL Query which answers the question. Note that it is sometimes possible to misinterpret the







read carefully what is being asked and create an SQL Query which answers the question. Note that it is sometimes possible to misinterpret the meaning of a question. Q 1 Q 2 Level 1 Create your own table with a minimum of 3 columns. You must use at least 3 different kinds of data types. Example: VARCHAR(50), NUMERIC(5,2), etc.. You must declare a Primary Key using an out-of-line constraint. Be sure to add a Drop Table at the top as well. Note: You cannot use any of the tables/columns used in the class slides or the demos. Your table/columns should be relatively unique (we understand some common column names will be re-used). If you have the same table/column names as another student, that will be considered to be plagiarism. Level 2 Using your table from question 1: Create a minimum of 4 INSERTS. On one of your INSERTS, do not specify all of your columns. Be sure to write a comment above the INSERT with less columns and explain what is missing in a full English sentence. You should write a simple SELECT after your INSERTS to see the new data. Expected Result Table TableName created. Expected Result 1 row inserted. 1 row inserted. 1 row inserted. 1 row inserted. 3 Using your table from question 1: Create an UPDATE statement that changes 3 or more 1 row updated. columns. Only 1 row should be updated.. You should write a simple SELECT after your UPDATE to see SELECT result the new data. Create a DELETE statement. This statement should only remove 1 row. Write a comment above each statement to describe what is happening in a full english sentence. You should write a simple SELECT after your DELETE to see that the data is now gone. 1 row deleted. no rows selected 4 Create an ERD based on the following business rules regarding Planes and routes. Using the following link to to learn how to create an ERD using diagrams.net: https://tinyurl.com/y6owbf97) You must label each relationship line with a verb and use the appropriate cardinality symbols. Be sure to label PRIMARY and FOREIGN KEYS and all column names. Note: You do not need datatypes in your ERD. Business Rules: A route will not happen without a plane. The same route happens with different planes over time. A plane does not have to fly a route. A plane can fly on many different routes. The following rules will be used in Question 5 as well. We can describe a Route with the following attributes and conditions: Routing ID: A 6 digit series of numbers and letters. It is never less or more than 6. Length Of Route: The number of approximate hours a flight should take on this route. This number is optional, but when present it must be a positive number less than 20 hours. Departure City Name and Arrival City Name. These names are required and are 85 characters or less. Entity Relationship Diagram File Random fact: Fun fact: The largest city name in the world is... Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoc h in New Zealand. 5 We can describe a plane with the following attributes and conditions: Plane serial number: An up to 10 digit series of numbers. Plane name: Is required and is up to 100 characters in length. Fuel capacity: An optional number representing the number of litres of fuel the plane can hold. This value can have 2 decimals and must be large enough to contain the largest plane's fuel tank which is just over 300,000 litres. (Note: there are no specific rule restrictions for fuel capacity other than defining the appropriate data type) When a plane flies a route, we must know two additional attributes: Departure Date and Arrival Date: Both are dates indicating a year, month and day. These dates are both required. Arrival Dates cannot happen before departure dates. CREATE the tables and any CONSTRAINTS specified for the Routes & Planes business rules above. Create one valid INSERTS on each table. Create INSERT statements to violate... one of the NOT NULL constraints, one of Foreign Key constraint, Any two of the Check constraints. You must write a comment above each failing INSERT and describe what is being tested. For example, if you had the follow Table with column constraint: CREATE TABLE ExampleTable ( Name VARCHAR(50) NOT NULL ); -- The following INSERT will violate the NOT NULL -- constraint on the Name column. INSERT INTO ExampleTable (Name) VALUES (NULL); In this assignment you will create a new .SQL file using Oracle SQL Developer. Please rename your file to follow the format: assignment#_firstname_lastname.sql For Example: assignment1_scott_wachal.sql Use the appropriate LEARN DropBox to upload your files. If you need to upload a newer version, you may do so before the deadline, but only the newest copy will be graded by your instructor.
Step by Step Solution
3.47 Rating (160 Votes )
There are 3 Steps involved in it
Lets Create a student Table with 3 attributes Studen... View full answer
Get step-by-step solutions from verified subject matter experts
