Database Systems: Design, Implementation, & Management
11th Edition
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
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 7, Problem 8P
Program Plan Intro
Table Creation:
Creating table comes under Data Definition Language (DDL). Syntax for creating table is as follows:
CREATE TABLE TABLE_NAME (
Column1 datatype,
Column2 datatype,
…
);
ALTER TABLE Statement:
“ALTER TALE” statement comes under Data Definition Language. It is used to modify column, add constraints, add column(s), drop column, rename column name and table name, drop constraints, and so on.
Syntax:
Syntax to drop constraint is as follows:
ALTER TABLE table_Name DROP CONSTRAINT constraintName;
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Write the SQL code to create a copy of EMP_1, naming the copy EMP_2. Then write the SQL code that will add the attributes EMP_PCT and PROJ_NUM to its structure. The EMP_PCT is the bonus percentage to be paid to each employee. The new attribute characteristics are shown next: EMP_PCT NUMBER(4,2) PROJ_NUM CHAR(3)
WEEK 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.
this is SQL.
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 - Prob. 7PCh. 7 - Prob. 8PCh. 7 - Write the SQL code to change the EMP_PCT value to...Ch. 7 - Prob. 10PCh. 7 - Prob. 11PCh. 7 - Write the SQL code that will change the PROJ_NUM...Ch. 7 - Prob. 13PCh. 7 - Prob. 14PCh. 7 - Prob. 15PCh. 7 - Prob. 16PCh. 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 - Prob. 22PCh. 7 - Prob. 23PCh. 7 - Prob. 24PCh. 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 - Prob. 45PCh. 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 - Write the SQL code to create the table structures...Ch. 7 - The following tables provide a very small portion...Ch. 7 - Prob. 67CCh. 7 - Prob. 68CCh. 7 - Prob. 69CCh. 7 - Prob. 70CCh. 7 - Prob. 71CCh. 7 - Prob. 72CCh. 7 - Prob. 73CCh. 7 - Prob. 74CCh. 7 - Prob. 75CCh. 7 - Prob. 76CCh. 7 - Prob. 77CCh. 7 - Prob. 78CCh. 7 - Prob. 79CCh. 7 - Prob. 80CCh. 7 - Prob. 81CCh. 7 - Prob. 82CCh. 7 - Prob. 83CCh. 7 - Prob. 84CCh. 7 - Prob. 85CCh. 7 - Prob. 86CCh. 7 - Prob. 87CCh. 7 - Prob. 88CCh. 7 - Prob. 89CCh. 7 - Prob. 90CCh. 7 - Prob. 91CCh. 7 - Prob. 92CCh. 7 - Prob. 93CCh. 7 - Prob. 94CCh. 7 - Prob. 95CCh. 7 - Prob. 96CCh. 7 - Prob. 97CCh. 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
- 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_forwardSQL server Answer question 5arrow_forwardSQL ( ORACLE SQL DEVELOPER ) : THIS IS FIRST , SECOND AND THIRD TABLE for the Task 1 to solve : create table author_45( auth_name char(50), gender char(1), age number(3), nationality char(50), PRIMARY KEY (auth_name) ); create table book_45( isbn number(10), title char(50), ver_no number(2), publisher char(50), PRIMARY KEY (isbn) ); create table writtenBy_45( isbn number(10), auth_name char(50), yr_published number(4), price number(3), no_copy number(4), PRIMARY KEY (isbn,auth_name), foreign key (isbn) references book_45, foreign key (auth_name) references author_45 ); insert into author_45 values ('Benoit','F',42,'French'); insert into author_ 45 values ('Antonini','M',33,'Italian'); insert into author_ 45 values ('McAven','F',31,'Australian'); insert into author_ 45 values ('Williams','M',90,'British'); insert into book_45 values (101,'atabases',1,'Possum'); insert into book_45 values (202,'SQL Primer',2,'Hall'); insert into book_45 values…arrow_forward
- In 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_forwardSQL: Create a SQL query that uses a correlated subquery to display the descriptions for products provided by a vendor in area code 904. The outer query will use the PRODUCT table, then use WHERE EXISTS, then the subquery which will use the VENDOR and PRODUCT tables via a join (a join should be used here). [hint: you should have 3 records of output]. My code: select p_descript from product where exist(select v_areacode from vendor where v_areacode = '904') ; I am getting an error but I can't see what is missing. ORA-00936: missing expressionarrow_forwardIn SQL, write the appropriate statements to insert default values for these three tables, each table containing 5 insertsarrow_forward
- Q1. 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_forwardWrite a to display user name and password. Password should be generated by concatenating first three characters of user name and first three numbers in phone number and give an alias name as PASSWORD. Sort the result based on user name. SQL Code Required BUSES number(11) BUS_NO BUS_NAME varchar2(20) t TYPE TOTAL SEATS number(11) = AVAIL_SEATS number(11) SCHEDULE P SCHEDULE ID TRAVEL DATE SOURCE DESTINATION varchar2(20) t O BUS NO DURATION varchar2(3) dated varchar2(20) t varchar2(20) t BUS NO number(11)O number(11) # PAYMENTS DISCOUNTS DISCOUNT ID DISCOUNT_AMOUNT number(11) # varchar2(3) TICKET ID P PAYMENT_ID varchar2(3) t BD IDOO TICKET_ID OE O BD_ID O DISCOUNT_ID varchar2(3) varchar2(3) number(11)DISCOUNT_ID TICKETS P TICKET ID varchar2(3) CHEDULE ID p SCHEDULE ID varchar2(3)O number(11) # FARE USER ID PUSER ID NO SEATS number(11) O number(11) # USERS number(11) varchar2(20) t ADDRESS varchar2(100) t number(11) # EMAILID varchar2(30) t PUSER ID primary key - not null NAME e foreign…arrow_forwardWrite a PL/SQL stored procedure to insert a row in the "employees" table. Use %type to declare each variable of correct/compatible type, matching each column of employee table. The procedure call must send the value to each column at the run time. DEPARTMENTS LOCATIONS * DEPARTMENT_ID * DEPARTMENT_NAME MANAGER_ID LOCATION_ID P P * LOCATION_ID STREET ADDRESS POSTAL_CODE * CITY STATE_PROVINCE F JOB_HISTORY PF EMPLOYEE_ID P * START_DATE END DATE F * JOB_ID COUNTRY_ID F DEPARTMENT_ID EMPLOYEES * EMPLOYEE_ID FIRST_NAME * LAST_NAME U * EMAIL PHONE_NUMBER HIRE_DATE * JOB_ID SALARY P COUNTRIES * COUNTRY_ID COUNTRY_NAME F P JOBS REGION_ID * JOB_ID * JOB_TITLE MIN_SALARY MAX_SALARY P COMMISSION_PCT REGIONS F MANAGER_ID * REGION_ID REGION_NAME F DEPARTMENT_ID IParrow_forward
- Quick Answer pleasearrow_forwardIn the following PL/SQL block, determine the values and data types for each of the following cases: DECLARE v_customer VARCHAR2(50) := 'Womansport2'; v_credit_rating VARCHAR2(50) := 'VERY_GOOD'; BEGIN DECLARE v_customer NUMBER(7) := 201; v_nmae VARCHAR2(25) := 'Unisports'; BEGIN V_credit_rating := 'GOOD'; END; END; The value of v customer in the nested block is: The value ofv name in the nested block is: The value of v _credit_rating in the nested block is: The value of v customer in the main block is: The value of v name in the main block is: The value of v_credit_rating in the main block is:arrow_forwardTrying to write statements for these shown here and having issues with them workingarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher: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