Use 0 for average sales per employee for such a region when calculating the 2nd and the 3rd column.Äot Items, Cargo Concat, JSON Stock, Employee Sales, Index Performance, Matching Clothes, Bill Discount, Cultivated Fields, Reservations Report, Accounts Trigger, Customer Paging, Employee Tree, Student Max Score, Manager Sales, Manager Sales, Root Menu, Agents, Developers, Authors, Autocomplete, Bank Branches, Cheapest Product, Countries, Hospital Patients, Rectangles, Restaurant Menu, Poll, Sales, Employee Manager, Auto Show, Welfare Organization, Tasks, Student Rankings, Student Activities, Youngest Child, Average Salary, Movie Genres, ATM Locations, Merge Stock Index, Ban Users, Department Report, Ingredients, Roads, Retirees, Student Management, New Wages, Research Funding, Guest List, Player Division, Popular Category, Movies Live, Delete Orders, Users and Accounts, Product Data, Projects, Transactions, River Discharge, SMS Messages, Menu Items, Karting Leaderboard, Movies. A region with no sales should be also returned. The difference between the average sales of the region with the highest average sales, and the average sales per employee for the region (average sales to be calculated as explained above).Ä®mployees can have multiple sales.Average sales per employee for the region (Average sales = Total sales made for the region / Number of employees in the region).Management requires a comparative region sales analysis report. The following tables contain the data: TABLE regionsįOREIGN KEY (regionId) REFERENCES regions(id)įOREIGN KEY (stateId) REFERENCES states(id)įOREIGN KEY (employeeId) REFERENCES employees(id) RIGHT JOIN SELECT * FROM TABLE1 RIGHT JOIN TABLE2 ON condition 4.An insurance company maintains records of sales made by its employees. LEFT JOIN SELECT * FROM TABLE1 LEFT JOIN TABLE2 ON condition 3. INNER JOIN SELECT * FROM TABLE1 INNER JOIN TABLE2 where condition 2. How to delete stored procedure DROP PROCEDURE sp_name Joins 1. How to call Stored procedure CALL sp_name 3. Create a Stored Procedure CREATE PROCEDURE sp_name(p1 datatype)Ä®ND 2. Drop a Trigger DROP TRIGGER trigger_name Stored Procedures 1. Create a Trigger CREATE TRIGGER trigger_name trigger_time trigger_event Deleting a View DROP VIEW View_name Triggers 1. How to call view SELECT * FROM View_name 3. DROP INDEX DROP INDEX index_name ON table_name Views 1. CREATE INDEX CREATE INDEX index_name on table_name(column_name) ĬREATE UNIQUE INDEX index_name on table_name(column_name) 2. And if I want to send the output of a query into some other command or save it to a file, the CLI is way easier than any GUI. DELETE DELETE FROM table_name where condition Example DELETE from EMPLOYEE where empId='0001' Indexes 1. On the other hand, the command line is so much faster to open and get going - I can 'Windows+R cmd mysql ' in under two seconds.WHERE condition Example UPDATE EMPLOYEE SET dept = 'Sales' WHERE empId='0001' 4. Example SELECT * FROM EMPLOYEE where dept ='sales' 3. Example INSERT INTO EMPLOYEE VALUES (0001, 'Ava', 'Sales') 2. This system is developed by ORACLE cooperation. ![]() ![]() As it is open source so anyone in this world can use this system. INSERT INSERT INTO table_name (column1, column2, column3. MySQL is the most common open-source software, nowadays every other person relies on MySQL for its database. COMMENT Single-Line Comments: -Line1 Multi-Line comments: /* Line1, RENAME RENAME TABLE table_name1 to new_table_name1 6. ![]() ALTER ALTER TABLE Table_name ADD column_name datatype Example INSERT INTO EMPLOYEE VALUES (0001, 'Dave', 'Sales') 3. Supports many operating systems like Linux*,CentOS*, Solaris*,Ubuntu*,Windows*, MacOS*,FreeBSD* and others.High productivity as it uses stored procedures, triggers, views to write a highly productive code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |