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
Please use following table information to answer the exercises.
SQL> DESC DEPARTMENTS
Name Null? Type
----------------------------------------- -------- ----------------------------
DEPARTMENT_ID NOT NULL NUMBER(4)
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER(6)
LOCATION_ID NUMBER(4)
SQL> DESC DEPARTMENTS
Name Null? Type
----------------------------------------- -------- ----------------------------
DEPARTMENT_ID NOT NULL NUMBER(4)
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER(6)
LOCATION_ID NUMBER(4)
SQL> DESC EMPLOYEES
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
Name Null? Type
----------------------------------------- -------- ----------------------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
12. Display the last name, hire date, and day of the week on which the employee started. Label the column
DAY. Order the results by the week starting with Monday.
Expert Solution
arrow_forward
Step 1
Introduction:
SQL stands for Structured Query Language and is a programming language designed to manage data in relational databases. It can be used to create, update, delete, and retrieve data stored in databases, as well as create stored procedures and other database objects.
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
- You've been asked to create a database for a local zoo. The database consists of the following tables: Animals This table contains the following data about all animals in the zoo. animal ID animal name animal birthdate species habitat Habitats This table contains data about the habitats in the zoo. Each animal lives in a specific habitat. The habitat table should include the following data habitat name habitat location Exercises Complete the following exercises to create an executable SQL script which is the physical design for this database. You should be able to execute this script to create and populate the database with test data. Write a query to create the zoo database. Write queries to create the tables. Be sure to include primary keys for each table and the required foreign keys and referential ntegrity actions. Add approriate indexes. This database requires at least 2 indexes in addition to those automatically created by MySQL. Add at least 5 rows to each table.arrow_forwardlease help with the below regarding VBA and Access SQLarrow_forwardPlease provide the appropriate SQL syntax to create a database named "Construct"?arrow_forward
- SQL script which is the physical design for this database ### Animals This table contains the following data about all animals in the zoo. - animal ID (primary key) - animal name - animal birthdate - species - habitat (foreign key) [1 habitat to many relationship] ### Habitats This table contains data about the habitats in the zoo. Each animal lives in a specific habitat. The habitat table should include the following data - habitat name, foreign key) - habitat location ### Database CREATE DATABASE zoo; Write queries to create the tables. Be sure to include primary keys for each table and the required foreign keys and referential integrity actions. Add appropriate indexes. This database requires at least 2 indexes in addition to those automatically created by MySQL.arrow_forwardhow to Create three or more SQL Data Control Language (DCL) Statements using the Homework Database: EMPLOYEE, STORE, REGION, and SUPPLIER Database. Create a new user statement for the database. The user name should be based on yourself containing your name. Statements that grant privileges to the new user. Statements granting privileges to at least 2 of the tables in the assigned database Statements that revoke privileges to the new user. Statements revoking privileges to at least 2 of the tables in the assigned Database the home work data base: -- creating the RegionStore DataBase DROP DATABASE IF EXISTS RegionStore; CREATE DATABASE RegionStore; USE RegionStore; -- creating the Region table CREATE TABLE Region ( regionID VARCHAR(10), regionName VARCHAR(50), supervisor VARCHAR(50), CONSTRAINT PRIMARY KEY (regionID) ); -- creating the store table CREATE TABLE Store ( storeID VARCHAR (10), storeAddress VARCHAR (50), phone…arrow_forwardA SQL Data Manipulation command like UPDATE or INSERT immediately saves the result to disk without further intervention from the user. Question 31 options: 1) True 2) Falsearrow_forward
- help with sql class 1. Report the names of the professors who work on 'project01'. 2. Report the names of the students who do not have a supervisor.arrow_forward1.What is the result when the following SQL query is executed on a table named products? Choose the most correct answer. SELECT AVG(Products)FROM Products; Group of answer choices The query results in an error because the is no AVG function None of the above The query results in an error be cause a column is not specified The query returns the average of the Products table 2. If the primary key in the Employee table is located in the "ID" column what is the maximum number of results the following SQL SELECT query will return? SELECT *FROM EmployeeWHERE ID = 15; Group of answer choices 2 1 3 Do not have enough information to determine the answer 0arrow_forwardThank you for helping! Write the SQL code to produce the total number of hours and charges for each of the projects represented in the ASSIGNMENT table. The result is shown as below. Write the SQL code to display the information of employees who are working as either programmer or system analyst. Write the SQL code to produce job_descriptions(job_title) of employees who are working at project ‘Evergreen’.arrow_forward
- Answer the following SQL questions using MySQL command language in MySQL Workbench, sakila database environment!arrow_forwardPlease use following table information to answer the questions?SQL> DESC DEPARTMENTSName Null? Type----------------------------------------- -------- ----------------------------DEPARTMENT_ID NOT NULL NUMBER(4)DEPARTMENT_NAME NOT NULL VARCHAR2(30)MANAGER_ID NUMBER(6)LOCATION_ID NUMBER(4) SQL> DESC EMPLOYEESName Null? Type----------------------------------------- -------- ----------------------------EMPLOYEE_ID NOT NULL NUMBER(6)FIRST_NAME VARCHAR2(20)LAST_NAME NOT NULL VARCHAR2(25)EMAIL NOT NULL VARCHAR2(25)PHONE_NUMBER VARCHAR2(20)HIRE_DATE NOT NULL DATEJOB_ID NOT NULL VARCHAR2(10)SALARY NUMBER(8,2)COMMISSION_PCT NUMBER(2,2)MANAGER_ID NUMBER(6)DEPARTMENT_ID NUMBER(4) Exercises:1. Display the last name and current job title of each employee, along with the department name they arecurrently working in. Label the columns "LAST NAME", "JOB TITLE", and "DEPARTMENT".2. Display the average salary for each department, along with the department name and…arrow_forwardHow to create tables, sequences, and indexes Exercises Write a script that adds an index to the order_date column in the Orders table in the mgs schema. Write a script that implements the following design: In the Downloads table, the user_id and product_id columns are the foreign keys. Create these tables in the ex schema. Create the sequences for the user_id, download_id, and product_id columns. Include a PL/SQL script to drop the table or sequence if it already exists. Include any indexes that you think are necessary. Write a script that adds rows to the database that you created in exercise 2. Add two rows to the Users and Products tables. Add three rows to the Downloads table: one row for user 1 and product 2; one row for user 2 and product 1; and one row for user 2 and product 2. Use the SYSDATE function to insert the current date into the download_date column. Use the sequences created in the previous exercise to get the values for the user_id, download_id, and product_id…arrow_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