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
11. Write a query in SQL to update an existing view named VE having columns (P,Q) to have columns (P,Q,R) from the table T1.
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
- What advantages does the ISNULL function offer when dealing with missing data in SQL?arrow_forwardCreate a PL/SQL block to retrieve and display information for all employees. Display the employee ID, manager ID, date of hire, and if any of the employee territories is in the region "Southern". CREATE TABLE Employees ( EmployeeID NUMBER NOT NULL, LastName VARCHAR2(20) NOT NULL, FirstName VARCHAR2(10) NOT NULL, Title VARCHAR2(30), TitleOfCourtesy VARCHAR2(25), BirthDate DATE, HireDate DATE, Address VARCHAR2(60), City VARCHAR2(15), Region VARCHAR2(15), PostalCode VARCHAR2(10), Country VARCHAR2(15), HomePhone VARCHAR2(24), Extension VARCHAR2(4), Photo LONG RAW, Notes VARCHAR2(600), ReportsTo NUMBER, PhotoPath VARCHAR2(255), CONSTRAINT PK_Employees PRIMARY KEY (EmployeeID), CONSTRAINT FK_Employees_Employees FOREIGN KEY (ReportsTo) REFERENCES Employees(EmployeeID) ) / CREATE TABLE EmployeeTerritories ( EmployeeID NUMBER NOT NULL, TerritoryID VARCHAR2(20) NOT NULL, CONSTRAINT PK_EmpTerritories PRIMARY KEY (EmployeeID, TerritoryID), CONSTRAINT FK_EmpTerri_Employees FOREIGN KEY (EmployeeID)…arrow_forwardTask 1: Run lab_emp.sql and lab_students.sql, this will create 2 tables for you (emp and students) and will fill them with data. 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); 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);…arrow_forward
- NO PAPER WORK ONLY TYPED ANSWERSarrow_forward2. Change the CONTACT view so that no users can accidentally perform DML operations onthe view. SQL commandsarrow_forwardCreate a function to increment the salary of employees of an organization by 15%, and for employees with department ID 100 give another 10% hike on the updated salary. Also, write the query to update the salary of all records of the salary column in the employee table using the created function. In PL/SQLarrow_forward
- d) Write SQL query to insert the entry ("Shaun", "Paul", "Football", 4) in the table playerEntries(first_name, last_name, category, level).arrow_forwardWrite Create Table SQL statements based on the above ERD. All tables must have primary keys. All tables must have appropriate foreign key constraints. Foreign keys must have the same name, datatype and size of the primary key that they refer to The following columns datatypes and sizes must be used: bid,authid / number(4) title,sname,fname / varchar2(30) sellingprice, payrate / number(6,2) Table Column Type Range author sname & fname Unique book title Not Null book sellingprice Check not negative allocation payrate Check 1 to 79.99arrow_forwardIN MYSQL 1. Write a query to create the “Student” table (SID, Sname, SAge, SDept, SCity), where the Student ID and Student Name cannot be NULL.2. Write a query to alter the above “Student” table, where a new column of Date of Birth (DOB) must be added, and it should not have any NULL values.3. Write a query to alter the “Student” table, where a CHECK constraint must be added to the “SCity” column and it must be “Vellore”.arrow_forward
- Practice 1 (continued) 7. Show the structure of the EMP table. Create a query to display the name, job. hire date, and employee number for each employee, with employee number appearing first. Save your SQL statement to a file named plq7.sql. Name Null? Туре EMPNO NOT NULL NUMBER(4) ENAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SAL NUMBER(7,2) СOMM NUMBER(7,2) DEPTNΟ NUMBER(2) 8. Run your query in the file plq7.sql. EMPNO ENAME JOB HIREDATE 7369 SMITH CLERK 17/12/1980 7499 ALLEN SALESMAN 20/02/1981 7521 WARD SALESMAN 22/02/1981 7566 JONES ΜΑΝAGER 02/04/1981 7654 MARTIN SALESMAN 28/09/1981 7698 BLAKE MANAGER 01/05/1981 7782 CLARK MANAGER 09/06/1981 7788 SCOTT ANALYST 09/12/1982 7839 KING PRESIDENT 17/11/1981 7844 TURNER SALESMAN 08/09/1981 7876 ADAMS CLERK 12/01/1983 7900 JAMES CLERK 03/12/1981 7902 FORD ANALYST 03/12/1981 7934 MILLER CLERK 23/01/1982 14 rows selected.arrow_forwardProblem 9 Write a query to count the number of invoices.arrow_forwardCreate an anonymous block in PL/SQL to list all the countries from Country table where Currency contain keyword ‘Dollar’. Perform following steps: Create user define type with name of the country, currency.Type should contain datatype for name and currency using %type only.Display should include Name of the country, currency code using user defined type. Filter for the data : All the countries from Country table where Currency contain keyword ‘Dollar’.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