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
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=sharing
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
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
- Please help, I know it's hard but no one else is willing to try and I am lost and spent three days on this so far. Write a query to display the author ID, first and last name for all authors who have ever written a book with the subject Programming. Sort the results by author's last name (Figure P7.106). In the SQL Query do the following Select clause: Display the columns stated in the problem statement From clause: AUTHOR table Where clause: authors who have ever written a book with the subject Programming. (Hint: Subquery) Order by clause: Sort the results by author last namearrow_forwardP7arrow_forwardMICROSOFT SQL SERVER ONLY CURSOR T-SQL Obtain the name and credit limit of the customer whose number currently is stored in I_CUSTOMER_NUM. Place these values in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. Output the content of I_CUSTOMER_NAME and I_CREDIT_LIMIT.arrow_forward
- Write a ASQ statement to return to see all of the first names in the People table. SELECT first name FROM people; WHERE FROM People first name; FROM People SELECT first_name; First name WHERE FROM People;arrow_forwardThe given SQL creates a Movie table and inserts some movies. The SELECT statement selects all movies. Press the Run button to produce a result table. Verify the result table displays five movies. Modify the SELECT statement to only select movies released after October 31, 2015: SELECT*FROM Movie WHERE ReleaseDate >'2015-10-31'; Then run the SQL again and verify the new query returns only three movies, all with release dates after October 31, 2015. CREATE TABLE Movie ( ID INT, Title VARCHAR(100), Rating VARCHAR(5), ReleaseDate DATE); INSERT INTO Movie VALUES (1, 'Rogue One: A Star Wars Story', 'PG-13', '2016-12-10'), (2, 'Hidden Figures', 'PG', '2017-01-06'), (3, 'Toy Story', 'G', '1995-11-22'), (4, 'Avengers: Endgame', 'PG-13', '2019-04-26'), (5, 'The Godfather', 'R', '1972-03-14'); -- Modify the SELECT statement:SELECT *FROM Movie;Where ReleaseDate > '2015-10-31';arrow_forwardcode of create table and insert table only pleasearrow_forward
- 2. Write a SQL statement to insert a new user with userId ‘XXXXX’ into the users table and populate at least 5 other columns including column userName. Note: userName column is varchar(20) and its value must be unique in the table users. DO NOT insert into the “created” column but pay attention to it’s value after the insert Paste the SQL below.arrow_forwardDatabase Q1: Select the correct SQL statement to provide the user Samer with read only permission on Employees table a) Grant read on Employee where username = Samer; b) Grant read only on Employee to Samer; c) Grant select to Samer on Employee; d) Grant select on Employee to Samer; Q2: Based on the TWO schema structures below, which SQL statement will create a view to show department names where each department has at least 5 employees? Employee (E_ID, E_Name, D_ID, E_Salary) Department (D_ID, D_Name, D_Address) (Select one) a) Create View Dept_Emp as select D_Name, count(E_ID) from Employee, Department where Employee D_ID = Department D_ID Group by D_Name Where count (E_ID) >= 5; b) Create View Dept_Emp as select D_Name, count(E_ID) from Employee D_ID = Department D_ID Group by D_Name Having count (E_ID) >= 5; c) Create View Dept_Emp as select D_Name, count(D_ID) from Employee, Department where Employee D_ID = Department D_ID Group by D_Name Having count (E_ID) >= 5; d)…arrow_forwardCREATE TABLE Employee( firstName char(30) , lastName char(30) , hireDate date ,empNo int , empInitial char(30) , years int ); Write the SQL syntax to create an insert statement for the employee table you created above.arrow_forward
- IN SQL If you omitted the WHERE clause of SELECT statement, the query returns an error because the where clause is required. Select one: True Falsearrow_forwardWrite an SQL query using the NOT operator that will show all employeeinformation from the Employee table with the exception of EmployeeNumber 7344.arrow_forwardWhat are some common uses for the STRING_AGG function in SQL?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