
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
database : sql
Q1. Create the following tables:
- Carrier
Attribute name |
Type |
Size |
Constraint |
carrierID |
Varchar2 |
10 |
Primary key |
carrierName |
Varchar2 |
100 |
NOT NULL |
Phone |
Varchar2 |
50 |
LIKE ‘+966%’ |
Range |
Varchar2 |
30 |
Value is either ‘International’ or ‘Local’ |
- Review
Attribute name |
Type |
Size |
Constraint |
ReviewID |
INT |
|
Primary key |
Stars |
INT |
|
NOT NULL |
Comment |
Varchar2 |
70 |
|
Name |
Varchar2 |
50 |
Default ’User’ |
CustomerID |
INT |
|
Foreign key references customers |
ProductID |
INT |
|
|
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
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
- Write the SQL code necessary to create the table defined in the picture below:arrow_forwardQuestion 11 Write SQL statements to answer the following question based on the ERD below. Note: Display only the attribute(s) required in the question. You need to provide complete answers, writing just keywords like SELECT, FROM, WHERE will receive 0 point. Question: List course name, section ID, and the average student grade (as GPA) in that section, for each section that was offered in 'Spring 2010' and order the result in descending order of section ID. STUDENT PK G_number FirstName LastName Address REGISTRATION PK FK G_number PK FK Sectionid DateEnrolled Grade 140 (DC) ALT+N+F10 (Mac) COURSE PK CourseID PK CourseName Course Desc CourseDept F SECTION SectionID FK Course D Semester Year Է t + 78v ABC > 5 600arrow_forwardquestion 6 please use the picture below to answer the following question Write a SQL statement to define a constraint in the Position table to ensure the column position does not accept duplicates.arrow_forward
- By using this table answer this question in SQL: Show the department id, department name and the number of employees working in any department which has less than 4 employeesarrow_forwardWrite a query in SQL to display all the data of customers, in Table customers, that live in New York or California SELECT city FROM customers WHERE city = 'New York' OR city = 'California' SELECT * FROM customers WHERE city = 'New York' AND city = 'California' SELECT * FROM customers WHERE city = 'New York' OR city = 'California' SELECT ALL FROM customers WHERE city = 'New York' OR city = 'California' %3Darrow_forwardDatabase https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_allarrow_forward
- Instructions: Write the suitable SQL statement to answer the following questions based on the following tables ( image for better table) Table Name: Employee EMP_ID FNAME LNAME SALARY JOIN_DATE DEP_NO 101 John Abraham 10000 01-JAN-13 11 202 Michael Clarke 80000 01-JAN-13 22 303 Roy Thomas 70000 01-FEB-13 11 404 Tom Jose 60000 01-FEB-13 22 505 Jerry Pinto 65000 01-FEB-13 22 606 Philip Mathew 75000…arrow_forwardUse your ERD to define the table structures in the database using SQL DDL commands to build your schema.arrow_forwardIn SQL, write the appropriate statements to insert default values for these two tables, each table containing 5 insertsarrow_forward
- sql code sql code sql codearrow_forwardBased on the following authorication commands (ordered from 1 to 4), which of the following privileges is true, assuming that Ali is the owner of the database? Order By Ali 1 2 3 4 Select one: Omar Ali Ali Command Grant Select on Employee to Omar with grant option; Grant Select on Employee to Samer with grant option; Grant Update on Employee to Omar with grant option; Revoke Select on Employee From Omar Cascade; a) Ali and Omar have Update privilege on employee Ali has select privilege on employee b) Ali and Omar have Update privilege on employee Omar and Samer have select privilege on employee elect c) Ali and Omar have Update privilege on employee Ali and Omar have select privilege on employee d) Ali and Omar have Update privilege on employee Ali, Omar and Samer have select privilege on employeearrow_forwardCreate a Pl SQL package named EMP_PKG which will have the above three functions and procedures as follows: CALC_TAX - private CHECK_FNAME - Public AVG_SAL - Publicarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education