Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a create table command to create a relation that will hold the following data: Driver_Licence SSN First_name Last_Name Date_of_Birth State AB17893 9820124 Harvey Goldberg
- Write a create table command to create a relation that will hold the following data:
Driver_Licence | SSN | First_name | Last_Name | Date_of_Birth | State |
AB17893 | 9820124 | Harvey | Goldberg | 01/01/1982 | OH |
CD17673 | 8975382 | Paul | Maxwell | 02/10/1974 | CA |
GH92641 | 7394104 | Peter | Feynman | 05/17/2005 | HI |
VH02378 | 1325639 | Sally | Maxwell | 07/22/2000 | CA |
lD820381 | 1325640 | Sally | Feynman | 09/01/2013 | HI |
You will have to choose the datatype for each column. Also notice that:
- The Last Name cannot be NULL
- The State column should have UD as default value
- Driver_Licence is the primary key
- SSN should also be unique
- Now insert the data
- Write a command to update the record with Drivers Licence AB17893 to have NY as State
- Now delete the record with SSN 1325640
- Now update the two record with First Name Sally to have First Name Sal
- Create a view that holds the CA records only
- Insert a new record into the view. Does it also appear in the table?
- Now alter the table to make sure that also First Name cannot be null
- Now alter the table in order to add a new column named Points
- Now complete the data of this new column so that everyone has 0 points except for Peter, who has 1 point and Harvey who has 2. Will you INSERT or UPDATE?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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