The Driver Relationship team wants to create some workshops and increase communication with the active drivers in InstantRide. Therefore, they requested a new database table to store the driver details of the drivers that have had at least one ride in the system. Create a new table, ACTIVE_DRIVERS, from the DRIVERS and TRAVELS tables which contains the following fields:

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter5: Data Manipulation And Transaction Control
Section: Chapter Questions
Problem 6MC
icon
Related questions
Question
100%

The Driver Relationship team wants to create some workshops and increase communication with the active drivers in InstantRide. Therefore, they requested a new database table to store the driver details of the drivers that have had at least one ride in the system. Create a new table, ACTIVE_DRIVERS, from the DRIVERS and TRAVELS tables which contains the following fields:

  • DRIVER_ID CHAR(5) (Primary key)
  • DRIVER_FIRST_NAME VARCHAR(20)
  • DRIVER_LAST_NAME VARCHAR(20)
  • DRIVER_DRIVING_LICENSE_ID VARCHAR(10)
  • DRIVER_DRIVING_LICENSE_CHECKED BOOL
  • DRIVER_RATING FLOAT

 

The code is supposed to look something like this but I'm getting an error 

CREATE TABLE ACTIVE_DRIVERS(

  DRIVER_ID CHAR(5) NOT NULL,

  DRIVER_FIRST_NAME VARCHAR(20) NULL, 

  DRIVER_LAST_NAME VARCHAR(20) NULL,

  DRIVER_DRIVING_LICENSE_ID VARCHAR(10) NULL, 

  DRIVER_DRIVING_LICENSE_CHECKED BOOL NULL, 

  DRIVER_RATING FLOAT NULL

) as select D.DRIVER_ID, D.DRIVER_FIRST_NAME, D.DRIVER_LAST_NAME, D.DRIVER_DRIVING_LICENSE_ID, D.DRIVER_DRIVING_LICENSE_CHECKED, D.DRIVER_RATING 

FROM DRIVERS D JOIN TRAVELS ON  D.DRIVER_ID =TRAVELS.DRIVER_ID;

 

Output looks like 

DRIVER_ID DRIVER_FIRST_NAME DRIVER_LAST_NAME DRIVER_DRIVING_LICENSE_ID DRIVER_DRIVING_LICENSE_CHECKED DRIVER_RATING
2001 Willie Butler 1874501 1 4.4
2002 Justin Howard 1953853 1 4.8
2003 Anthony Walker 1735487 1 3.5
TRAVEL_ID
TRAVEL_START_TIME
TRAVEL_END_TIME
TRAVEL_START_LOCATION
TRAVEL_END_LOCATION
TRAVEL_PRICE
DRIVER_ID
CAR_ID
USER_ID
TRAVEL_DISCOUNT
5001
2019-10-01 04:04:55
2019-10-01 04:14:19
9614 York Road
84 Church Lane
15.44
2001
1003
3005
NULL
5002
2019-10-01 05:57:33
2019-10-01 06:12:33
47 Church Street
68 High Street
20.56
2001
1003
3006
NULL
5003
2019-10-01 13:35:20
2019-10-01 13:45:10
2 Windsor Road
95 West Street
12.32
2002
1001
3002
NULL
5004
2019-10-02 08:44:48
2019-10-02 09:15:28
9060 Mill Lane
27 Main Road
30.49
2003
1002
3001
0.13
5005
2019-10-02 16:38:54
2019-10-02 16:48:10
2 Queensway
24 Mill Lane
11.15
2001
1003
3007
NULL
5006
2019-10-03 19:12:14
2019-10-03 19:23:45
50 Main Road
93 Broadway
14.61
2003
1002
3007
0.10
5007
2019-10-03 16:06:36
2019-10-03 16:08:56
39 Park Road
91 West Street
4.41
2002
1004
3003
0.14
5008
2019-10-03 17:17:12
2019-10-03 17:37:42
37 The Drive
17 Stanley Road
25.12
2001
1003
3001
0.25
5009
2019-10-03 21:16:48
2019-10-03 21:26:18
77 Mill Road
724 Springfield Road
13.55
2001
1003
3005
NULL
5010
2019-10-03 23:21:40
2019-10-03 23:39:10
16 Church Road
30 North Road
25.62
2003
1002
3003
0.20
Transcribed Image Text:TRAVEL_ID TRAVEL_START_TIME TRAVEL_END_TIME TRAVEL_START_LOCATION TRAVEL_END_LOCATION TRAVEL_PRICE DRIVER_ID CAR_ID USER_ID TRAVEL_DISCOUNT 5001 2019-10-01 04:04:55 2019-10-01 04:14:19 9614 York Road 84 Church Lane 15.44 2001 1003 3005 NULL 5002 2019-10-01 05:57:33 2019-10-01 06:12:33 47 Church Street 68 High Street 20.56 2001 1003 3006 NULL 5003 2019-10-01 13:35:20 2019-10-01 13:45:10 2 Windsor Road 95 West Street 12.32 2002 1001 3002 NULL 5004 2019-10-02 08:44:48 2019-10-02 09:15:28 9060 Mill Lane 27 Main Road 30.49 2003 1002 3001 0.13 5005 2019-10-02 16:38:54 2019-10-02 16:48:10 2 Queensway 24 Mill Lane 11.15 2001 1003 3007 NULL 5006 2019-10-03 19:12:14 2019-10-03 19:23:45 50 Main Road 93 Broadway 14.61 2003 1002 3007 0.10 5007 2019-10-03 16:06:36 2019-10-03 16:08:56 39 Park Road 91 West Street 4.41 2002 1004 3003 0.14 5008 2019-10-03 17:17:12 2019-10-03 17:37:42 37 The Drive 17 Stanley Road 25.12 2001 1003 3001 0.25 5009 2019-10-03 21:16:48 2019-10-03 21:26:18 77 Mill Road 724 Springfield Road 13.55 2001 1003 3005 NULL 5010 2019-10-03 23:21:40 2019-10-03 23:39:10 16 Church Road 30 North Road 25.62 2003 1002 3003 0.20
DRIVER_ID DRIVER_FIRST_NAME
DRIVER_LAST_NAME DRIVER_DRIVING_LICENSE_ID DRIVER_START_DATE DRIVER_DRIVING_LICENSE_CHECKED
DRIVER_RATING
2001
Willie
Butler
1874501
2019-09-12
1
4.4
2002
Justin
Howard
1953853
2019-09-09
1
4.8
2003
Anthony
Walker
1735487
2019-09-15
3.5
2004
Еce
Yilmaz
1734747
2019-08-15
Transcribed Image Text:DRIVER_ID DRIVER_FIRST_NAME DRIVER_LAST_NAME DRIVER_DRIVING_LICENSE_ID DRIVER_START_DATE DRIVER_DRIVING_LICENSE_CHECKED DRIVER_RATING 2001 Willie Butler 1874501 2019-09-12 1 4.4 2002 Justin Howard 1953853 2019-09-09 1 4.8 2003 Anthony Walker 1735487 2019-09-15 3.5 2004 Еce Yilmaz 1734747 2019-08-15
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr