Database Systems: Design, Implementation, & Management
12th Edition
ISBN: 9781305627482
Author: Carlos Coronel, Steven Morris
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 7, Problem 2P
Having created the table structure in Problem 1, write the SQL code to enter the first two rows for the table shown in Figure P7.2.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
You have been told that you need to store the zip code for employees. Add a column to the EMPLOYEE table which will be used to store each employee’s zip code
Update two rows in the EMPLOYEE table and assign a zip code (must have a WHERE clause). (you MAY use 1 or 2 statements)
Write a query that includes each employee's last name, department name (not ID), and salary for each employee whose salary is less than the average for their department
SQL server
Answer question 5
1) Write the SQL code that will create the table structure for a table named EMP. This table is a subset of the EMPLOYEE table. The basic EMP table structure is summarized in the table below. (Note that the EMP_NUM is the PK)?
ATTRIBUTE(FIELD) NAME
DATADECLARATION
Constraints
EMP_NUM
INT
Auto generated Identifier, start from 101
EMP_LNAME
VARCHAR(15)
Not null
EMP_FNAME
VARCHAR(15)
Not Null
EMP_INITIAL
CHAR(1)
EMP_HIREDATE
DATE
Default value is system date
JOB_CODE
CHAR(3)
Make sure input is in the range500,501,502
Chapter 7 Solutions
Database Systems: Design, Implementation, & Management
Ch. 7 - Prob. 1RQCh. 7 - Explain why the following command would create an...Ch. 7 - Prob. 3RQCh. 7 - Explain why it might be more appropriate to...Ch. 7 - What is the difference between a column constraint...Ch. 7 - What are referential constraint actions?Ch. 7 - Rewrite the following WHERE clause without the use...Ch. 7 - Explain the difference between an ORDER BY clause...Ch. 7 - Explain why the following two commands produce...Ch. 7 - What is the difference between the COUNT aggregate...
Ch. 7 - Prob. 11RQCh. 7 - Prob. 12RQCh. 7 - Write the SQL code that will create the table...Ch. 7 - Having created the table structure in Problem 1,...Ch. 7 - Prob. 3PCh. 7 - Prob. 4PCh. 7 - Write the SQL code to change the job code to 501...Ch. 7 - Write the SQL code to delete the row for William...Ch. 7 - Write the SQL code that will restore the data to...Ch. 7 - Write the SQL code to create a copy of EMP_1,...Ch. 7 - Write the SQL code to change the EMP_PCT value to...Ch. 7 - Using a single command sequence, write the SQL...Ch. 7 - Prob. 11PCh. 7 - Write the SQL code that will change the PROJ_NUM...Ch. 7 - Write the two SQL command sequences required to:...Ch. 7 - Prob. 14PCh. 7 - Prob. 15PCh. 7 - Using the EMPLOYEE, JOB, and PROJECT tables in the...Ch. 7 - Write the SQL code that will produce the same...Ch. 7 - Write the SQL code to find the average bonus...Ch. 7 - Prob. 19PCh. 7 - Prob. 20PCh. 7 - Write the SQL code to calculate the ASSIGN_CHARGE...Ch. 7 - Using the data in the ASSIGNMENT table, write the...Ch. 7 - Prob. 23PCh. 7 - Write the SQL code to generate the total hours...Ch. 7 - Prob. 25PCh. 7 - Prob. 26PCh. 7 - Prob. 27PCh. 7 - Generate a listing of all purchases made by the...Ch. 7 - Using the output shown in Figure P7.29 as your...Ch. 7 - Prob. 30PCh. 7 - Prob. 31PCh. 7 - Use a query to compute the average purchase amount...Ch. 7 - Prob. 33PCh. 7 - Prob. 34PCh. 7 - Prob. 35PCh. 7 - Prob. 36PCh. 7 - Prob. 37PCh. 7 - Using the results of the query created in Problem...Ch. 7 - Create a query to find the balance characteristics...Ch. 7 - Prob. 40PCh. 7 - Prob. 41PCh. 7 - Prob. 42PCh. 7 - Prob. 43PCh. 7 - Prob. 44PCh. 7 - Write a query to display the SKU (stock keeping...Ch. 7 - Prob. 46PCh. 7 - Prob. 47PCh. 7 - Prob. 48PCh. 7 - Prob. 49PCh. 7 - Prob. 50PCh. 7 - Prob. 51PCh. 7 - Prob. 52PCh. 7 - Prob. 53PCh. 7 - Prob. 54PCh. 7 - Prob. 55PCh. 7 - Prob. 56PCh. 7 - Prob. 57PCh. 7 - Prob. 58PCh. 7 - Prob. 59PCh. 7 - Prob. 60PCh. 7 - Prob. 61PCh. 7 - Prob. 62PCh. 7 - Prob. 63PCh. 7 - Prob. 64PCh. 7 - Prob. 65PCh. 7 - Prob. 66PCh. 7 - Prob. 67PCh. 7 - Prob. 68PCh. 7 - Prob. 69PCh. 7 - Prob. 70PCh. 7 - Prob. 71PCh. 7 - Prob. 72PCh. 7 - Prob. 73PCh. 7 - Prob. 74PCh. 7 - Prob. 75PCh. 7 - Prob. 76PCh. 7 - Prob. 77PCh. 7 - Prob. 78PCh. 7 - Prob. 79PCh. 7 - Prob. 80PCh. 7 - Prob. 81PCh. 7 - Prob. 82PCh. 7 - Prob. 83PCh. 7 - Prob. 84PCh. 7 - Prob. 85PCh. 7 - Prob. 86PCh. 7 - Prob. 87PCh. 7 - Prob. 88PCh. 7 - Prob. 89PCh. 7 - Prob. 90PCh. 7 - Prob. 91PCh. 7 - Prob. 92PCh. 7 - Prob. 93PCh. 7 - Prob. 94PCh. 7 - Prob. 95PCh. 7 - Write the SQL code to create the table structures...Ch. 7 - The following tables provide a very small portion...Ch. 7 - Write the SQL command to save the rows inserted in...Ch. 7 - Write the SQL command to change the movie year for...Ch. 7 - Prob. 100CCh. 7 - Prob. 101CCh. 7 - Prob. 102CCh. 7 - Prob. 103CCh. 7 - Prob. 104CCh. 7 - Prob. 105CCh. 7 - Prob. 106CCh. 7 - Prob. 107CCh. 7 - Prob. 108CCh. 7 - Prob. 109CCh. 7 - Prob. 110CCh. 7 - Prob. 111CCh. 7 - Prob. 112CCh. 7 - Prob. 113CCh. 7 - Prob. 114CCh. 7 - Prob. 115CCh. 7 - Prob. 116CCh. 7 - Prob. 117CCh. 7 - Prob. 118CCh. 7 - Prob. 119CCh. 7 - Prob. 120CCh. 7 - Prob. 121CCh. 7 - Prob. 122CCh. 7 - Prob. 123CCh. 7 - Prob. 124CCh. 7 - Write a query to display the movie number, movie...
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
- How do you indicate that a column alias should be used?arrow_forwardSQL: THIS IS FIRST TABLE : create table emp ( eid number(7), fname char(20), lname char(20), salary number, primary key (eid) ); insert into emp values (1111111, 'ali', 'ahmed', 3500); insert into emp values(2222222, 'asma', 'dani', 2000); insert into emp values(3333333, 'hassan', 'ali', 4500); insert into emp values(4444444, 'khaled', 'shaalan',6000); insert into emp values(5555555, 'farhad', 'kokol', 7500); insert into emp values(6666666, 'amir', 'sheikh', 10000); insert into emp values(7777777, 'rahul', 'kolap', 11000); insert into emp values(8888888, 'halim', 'ziaey', 21000); insert into emp values(9999999, 'henna', 'bubaker', 30000); THIS IS SECOND TABLE : create table students ( sid number, fname char(20), lname char(20), avg number, age number, primary key (sid) ); insert into students values (1111111, 'ali', 'ahmed', 76, 21); insert into students values(2222222, 'asma', 'dani', 89, 20); insert into students values(3333333, 'hassan', 'ali', 67, 23); insert into…arrow_forwardWEEK SQL ASSIGNMENT Complete the following exercise: Alter your student table adding a new column called enroll_date using the datetime data type. Populate the new column (enroll_date) with the current date and time. Using your student table return the student first and last names concatenated with a space and then the enroll_date minus one month. Here is an example of the output: Name Date Jane Smith 2019-05-03 13:14:12 Tom Jones 2020-08-07 05:23:56 Using your student table return the month name for the enroll_date column. For example, if the enroll_date was 11-6-2019 then the month name would be June.arrow_forward
- in sql The EMPLOYEE table contains these columns: EMP_ID NOT NULL, Primary Key SSNUM NOT NULL, Unique LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) DEPT_ID NUMBER Foreign Key to DEPT_ID column of the DEPARTMENT table SALARY NUMBER(8,2). You execute this statement:CREATE INDEX emp_name_idx ON employee(last_name, first_name); Which statement is true? Select one: a. The statement creates a composite non-unique index b. The statement creates a composite unique index. c. The statement creates a function-based index. d. The statement fails because of a syntax error.arrow_forwardIn The SQL Oracle Application Using the UNION operator, write a query that displays the employee_id, job_id, and salary of ALL present and past employees. If a salary is not found, then just display a 0 (zero) in its place.arrow_forwardIn SQL When you use ALTER TABLE to add a column, the new column: Select one: a. Will not be created because you cannot add a column after the table is created b. Becomes the last column in the table c. Can be placed by adding a GROUP BY clause d. Becomes the first column in the tablearrow_forward
- please follow the stepsarrow_forwardQ1. Please write a query statement from emp table to display employee's empno, ename, length of ename, number of 'S',and number of 'L'. SQL> SELECT empno AS "EmpNo", ename AS "Emp Name", ... AS "Name Length", .... AS "# Of S", .... AS "# Of L"FROM emp; [IMAGE below] Material to answer the question above: Material: https://drive.google.com/file/d/14OwWDIybjAIeuHCO7McupV08gJs9nB-8/view?usp=sharing https://drive.google.com/file/d/1npRH8JoJ6GYBzPU3iNjLXluvCyhr2tMu/view?usp=sharingarrow_forwardIn SQL, write the appropriate statements to insert default values for these three tables, each table containing 5 insertsarrow_forward
- 6.7 LAB - Create Vehicle and EventVehicle tables The California DMV's completed table diagram is presented in the zyBook. The following is a portion of the table di Vehicle VehicleID TypeCode R YearNumber R MakeCode R ModelName R PlateID R VehicleEvent StateCode R -restrict- • VehicleID RegistrationDate -restrict- • EventNumberarrow_forwardQ1. Please write SQL codes to query data from dvd table based on below criteria Please write a SELECT statement to display different DVD title (the same title will be displayed one and only one time) and the first character of the DVD titles must be between ‘A’ and ‘L’. Please display the result in descending order (from ‘A’ to ‘L’ order). The result should be identical to below results: [screen-shot]arrow_forwardA customers table has the following columns: ID, NAME, AGE, ADDRESS and SALARY. Write an SQL code that will fetch the ID, NAME and SALARY fields from the CUSTOMERS table where the Salary is greater than 2000. Show resultarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781305627482Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781285196145Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos CoronelPublisher:Cengage Learning
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
dml in sql with examples; Author: Education 4u;https://www.youtube.com/watch?v=WvOseanUdk4;License: Standard YouTube License, CC-BY