To remove all rows from a table named Inventory without deleting the table itself, which SQL statement should you use? DELETE FROM Inventory; DROP TABLE Inventory; TRUNCATE TABLE Inventory; REMOVE * FROM Inventory;
Added by Lucy Y.
Step 1
DELETE FROM Inventory; - This statement will delete all rows from the Inventory table but not the table itself. So, this could be a correct answer. Show more…
Show all steps
Your feedback will help us improve your experience
Lucas Finney and 64 other Elementary Statistics a Step by Step Approach educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
'Which SQL Command is used to delete a table from the database: a) Update b) Alter c) Drop d) Select'
Sarvesh S.
With New Dept_id as (select x.dpt_code from department x where x.dpt_code not in (select e.dpt_id from employee e join department d on e.dep_id=d.dpt_code)) With New Dept_name as (select x.dpt_name from department x) SELECT employee.emp_id, employee.emp_name, employee.hire_date, employee.job_name, employee.dept_id, New Dept_id, New Dept_name from employee JOIN department on (employee.dep_id=department.dpt_code) department dpt_allotment, dpt_code, dpt_name employee commission, dep_id, emp_id, emp_name, hire_date, job_name, manager_id, salary Employee table consists of 1. Employees who is assigned to departments properly 2. Employees with dept_id as NULL 3. Employees with old department IDs and not available now in Department table Department Table contains 1. Active Records which is mapped to employees 2. New Departments which are created and not yet tagged to employees Write a MYSQL query which displays the records matching below criteria. a) Fetch all the records with dept_id as NULL in employee table and assign the result with newly added dept_id . b) Fetch all the records with old department IDs .Assign NULL value for new dept_id and Names for the invalid dept_ids . Output should be in below format: emp_id, emp_name, hire_date, job_name, dept_id , New Dept_id ,New Dept_name
Akash M.
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD