Akx DBMS
Akx DBMS
1
DATABASE MANAGEMENT SYSTEM - 202040302
INSERT INTO `contacts` (`contact_id`, `firstname`, `lastname`, `email`, `phone`, `customer_id`)
VALUES
(1, 'Flor', 'Stone', '[email protected]', '+1 317 123 4104', 1),
(2, 'Lavera', 'Emerson', '[email protected]', '+1 317 123 4111', 2),
(3, 'Fern', 'Head', '[email protected]', '+1 812 123 4115', 3),
(4, 'Shyla', 'Ortiz', '[email protected]', '+1 317 123 4126', 4),
(5, 'Jeni', 'Levy', '[email protected]', '+1 812 123 4129', 5),
(6, 'Matthias', 'Hannah', '[email protected]', '+1 219 123 4136', 6),
(7, 'Matthias', 'Cruise', '[email protected]', '+1 219 123 4138', 7),
(8, 'Meenakshi', 'Mason', '[email protected]', '+1 317 123 4141', 8),
(9, 'Christian', 'Cage', '[email protected]', '+1 219 123 4142', 9),
(10, 'Charlie', 'Sutherland', '[email protected]', '+1 317 123 4146', 10),
(11, 'Charlie', 'Pacino', '[email protected]', '+1 812 123 4150', 11),
(12, 'Guillaume', 'Jackson', '[email protected]', '+1 812 123 4151', 12),
(13, 'Daniel', 'Costner', '[email protected]', '+1 812 123 4153', 13),
(14, 'Dianne', 'Derek', '[email protected]', '+1 812 123 4157', 14),
(15, 'Geraldine', 'Schneider', '[email protected]', '+1 313 123 4159', 15),
(16, 'Geraldine', 'Martin', '[email protected]', '+1 313 123 4160', 16),
(17, 'Guillaume', 'Edwards', '[email protected]', '+1 616 123 4162', 17),
(18, 'Maurice', 'Mahoney', '[email protected]', '+1 616 123 4181', 18),
(19, 'Maurice', 'Hasan', '[email protected]', '+1 517 123 4191', 19),
(20, 'Diane', 'Higgins', '[email protected]', '+1 517 123 4199', 20),
(21, 'Dianne', 'Sen', '[email protected]', '+1 517 123 4201', 21),
(22, 'Maurice', 'Daltrey', '[email protected]', '+1 517 123 4206', 22),
(23, 'Tess', 'Roth', '[email protected]', '+1 313 123 4219', 23),
(24, 'Ka', 'Kaufman', '[email protected]', '+1 313 123 4222', 24),
(25, 'Sharyl', 'Montoya', '[email protected]', '+1 517 123 4225', 25),
(26, 'Daniel', 'Glass', '[email protected]', '+1 313 123 4226', 26),
(27, 'Rena', 'Arnold', '[email protected]', '+1 517 123 4228', 27),
(28, 'Arlyne', 'Ingram', '[email protected]', '+1 313 123 4230', 28),
(29, 'Willie', 'Barrera', '[email protected]', '+1 616 123 4234', 29),
(30, 'Mireya', 'Cochran', '[email protected]', '+1 313 123 4242', 30),
(31, 'Marlene', 'Odom', '[email protected]', '+1 616 123 4245', 31),
(32, 'Jaclyn', 'Atkinson', '[email protected]', '+1 313 123 4248', 32),
2
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(33, 'Al', 'Schultz', '[email protected]', '+1 517 123 4253', 33),
(34, 'Felicitas', 'Riley', '[email protected]', '+1 313 123 4255', 34),
(35, 'Cora', 'Calhoun', '[email protected]', '+1 313 123 4263', 35),
(36, 'Trula', 'Buckley', '[email protected]', '+1 517 123 4265', 36),
(37, 'Sasha', 'Wallace', '[email protected]', '+1 319 123 4271', 37),
(38, 'Caitlin', 'Hill', '[email protected]', '+1 515 123 4273', 38),
(39, 'Gino', 'Pickett', '[email protected]', '+1 319 123 4278', 39),
(40, 'Amira', 'Macdonald', '[email protected]', '+1 712 123 4280', 40),
(41, 'Mack', 'Morse', '[email protected]', '+1 319 123 4282', 41),
(42, 'Eboni', 'Jarvis', '[email protected]', '+1 319 123 4288', 42),
(43, 'Gabrielle', 'Dennis', '[email protected]', '+1 515 123 4290', 43),
(44, 'Classie', 'Norris', '[email protected]', '+1 319 123 4301', 44),
(45, 'Khalilah', 'Holman', '[email protected]', '+1 745 123 4306', 45),
(46, 'Isreal', 'Rose', '[email protected]', '+1 414 123 4307', 46),
(47, 'Verena', 'Hopper', '[email protected]', '+1 414 123 4308', 47),
(48, 'Audie', 'Flores', '[email protected]', '+1 608 123 4309', 48),
(49, 'Gertrude', 'Cooke', '[email protected]', '+1 608 123 4318', 49),
(50, 'Princess', 'Kane', '[email protected]', '+1 414 123 4323', 50),
(51, 'Jacinta', 'Faulkner', '[email protected]', '+1 414 123 4324', 51),
(52, 'Lashon', 'Wall', '[email protected]', '+1 414 123 4328', 52),
(53, 'Corliss', 'Mcneil', '[email protected]', '+1 608 123 4332', 53),
(54, 'Brock', 'Webb', '[email protected]', '+1 608 123 4344', 54),
(55, 'Melany', 'Mcmahon', '[email protected]', '+1 414 123 4347', 55),
(56, 'Rogelio', 'Kirby', '[email protected]', '+1 414 123 4348', 56),
(57, 'Wallace', 'Dillard', '[email protected]', '+1 414 123 4350', 57),
(58, 'Gia', 'Boyle', '[email protected]', '+1 745 123 4367', 58),
(59, 'Tennie', 'Gay', '[email protected]', '+1 414 123 4369', 59),
(60, 'Ophelia', 'Hurst', '[email protected]', '+1 715 123 4372', 60),
(61, 'Ciara', 'Flowers', '[email protected]', '+1 414 123 4373', 61),
(62, 'Birgit', 'Stephenson', '[email protected]', '+1 608 123 4374', 62), (63,
'Shameka', 'Spencer', '[email protected]', '+1 414 123 4376', 63),
(64, 'Alysa', 'Kane', '[email protected]', '+1 608 123 4378', 64),
(65, 'Fransisca', 'Reeves', '[email protected]', '+1 414 123 4381', 65),
(66, 'Jessika', 'Merritt', '[email protected]', '+1 612 123 4397', 66),
3
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(67, 'Agustina', 'Conner', '[email protected]', '+1 612 123 4399', 67),
(68, 'Roxanna', 'Wade', '[email protected]', '+1 612 123 4408', 68),
(69, 'Virgie', 'Mays', '[email protected]', '+1 612 123 4417', 69),
(70, 'Trang', 'Mcconnell', '[email protected]', '+1 612 123 4419', 70),
(71, 'Nada', 'West', '[email protected]', '+1 507 123 4421', 71),
(72, 'Catherina', 'Haney', '[email protected]', '+1 218 123 4429', 72),
(73, 'Harriette', 'Melton', '[email protected]', '+1 612 123 4434', 73),
(74, 'Willette', 'Rodgers', '[email protected]', '+1 315 123 4442', 74),
(75, 'Calandra', 'Williamson', '[email protected]', '+1 315 123 4447', 75),
(76, 'Tamatha', 'Delgado', '[email protected]', '+1 716 123 4457', 76),
(77, 'Felix', 'Ferguson', '[email protected]', '+1 518 123 4459', 77),
(78, 'Elwood', 'Hampton', '[email protected]', '+1 518 123 4464', 78),
(79, 'Josh', 'Roach', '[email protected]', '+1 518 123 4474', 79),
(80, 'Luanna', 'Scott', '[email protected]', '+1 914 123 4494', 80),
(81, 'Meryl', 'Cole', '[email protected]', '+1 518 123 4496', 81),
(82, 'Jannet', 'Elliott', '[email protected]', '+1 716 123 4575', 82),
(83, 'Fae', 'Glenn', '[email protected]', '+1 914 123 4578', 83),
(84, 'Francisco', 'Cummings', '[email protected]', '+1 315 123 4597', 84),
(85, 'Ermelinda', 'Benton', '[email protected]', '+1 716 123 4599', 85),
(86, 'Lasonya', 'Beard', '[email protected]', '+1 716 123 4605', 86),
(87, 'Rayna', 'Tran', '[email protected]', '+1 518 123 4617', 87),
(88, 'Annice', 'Boyer', '[email protected]', '+1 518 123 4618', 88),
(89, 'Ja', 'Whitfield', '[email protected]', '+1 914 123 4619', 89),
(90, 'Jaime', 'Lester', '[email protected]', '+1 518 123 4624', 90),
(91, 'Charlsie', 'Lindsey', '[email protected]', '+1 215 123 4644', 91),
(92, 'Jannette', 'Henry', '[email protected]', '+1 610 123 4657', 92),
(93, 'Margart', 'Mccall', '[email protected]', '+1 412 123 4662', 93),
(94, 'Twanna', 'Cleveland', '[email protected]', '+1 814 123 4663', 94),
(95, 'Bronwyn', 'Horn', '[email protected]', '+1 610 123 4664', 95),
(96, 'Jon', 'Petersen', '[email protected]', '+1 610 123 4667', 96),
(97, 'Denny', 'Daniel', '[email protected]', '+1 610 123 4669', 97),
(98, 'Avis', 'Moore', '[email protected]', '+1 717 123 4674', 98),
(99, 'Eden', 'Burke', '[email protected]', '+1 215 123 4676', 99), (100,
'Elisha', 'Lloyd', '[email protected]', '+1 412 123 4681', 100);
4
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
5
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
CREATE TABLE `customers` (
`customer_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`address` varchar(255) DEFAULT NULL,
`website` varchar(255) DEFAULT NULL,
`creditlimit` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
6
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(93, 'UnitedHealth Group', '2455 Rose Garden Rd, Pittsburgh, PA',
'http://www.unitedhealthgroup.com', 1200),
(94, 'CVS Health', '1812 Timberline Rd, Altoona, PA', 'http://www.cvshealth.com', 1200),
(95, 'General Motors', '141 Schiller St, Reading, PA', 'http://www.gm.com', 1200),
(96, 'Ford Motor', '1126 Pawlings Rd, Norristown, PA', 'http://www.ford.com', 1200),
(97, 'AT&T', '55 Church Hill Rd, Reading, PA', 'http://www.att.com', 1200),
(98, 'General Electric', '354 N Prince St, Lancaster, PA', 'http://www.ge.com', 1200),
(99, 'AmerisourceBergen', '115 Chestnut St, Philadelphia, PA',
'http://www.amerisourcebergen.com', 1400),
(100, 'Verizon', '2899 Grand Ave, Pittsburgh, PA', 'http://www.verizon.com', 1400),
(101, 'Chevron', 'Po Box 39, Indiana, PA', 'http://www.chevron.com', 1400),
(102, 'Costco', '1604 Broadway Ave, Pittsburgh, PA', 'http://www.costco.com', 1400),
(103, 'Fannie Mae', '4734 Liberty Ave, Pittsburgh, PA', 'http://www.fanniemae.com', 1400),
(104, 'Kroger', '21 Thornwood Rd, Harrisburg, PA', 'http://www.thekrogerco.com', 1400),
(105, 'Amazon.com', '3725 W Lake Rd, Erie, PA', 'http://www.amazon.com', 1400),
7
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
'http://www.airproducts.com', 2300),
(127, 'Alphabet', '36 W 34Th St, Erie, PA', 'http://www.google.com', 2400),
(128, 'Comcast', '1007 Mount Royal Blvd, Pittsburgh, PA',
'http://www.comcastcorporation.com', 2400),
(129, 'Target', '601 Market St, Philadelphia, PA', 'http://www.target.com', 2400),
(132, 'MetLife', '5122 Sinclair Ln, Baltimore, MD', 'http://www.metlife.com', 2400),
(133, 'Archer Daniels Midland', '680 Bel Air Rd, Bel Air, MD', 'http://www.adm.com', 2400),
(135, 'Freddie Mac', '8004 Stansbury Rd, Baltimore, MD', 'http://www.freddiemac.com', 2400),
(136, 'PepsiCo', '10209 Yearling Dr, Rockville, MD', 'http://www.pepsico.com', 2400),
(137, 'United Technologies', '3000 Greenmount Ave, Baltimore, MD', 'http://www.utc.com', 2400),
(139, 'Lowe?s', '1262 Vocke Rd, Cumberland, MD', 'http://www.lowes.com', 2400),
(140, 'UPS', '3314 Eastern Ave, Baltimore, MD', 'http://www.ups.com', 2400),
(142, 'Prudential Financial', '11200 Scaggsville Rd, Laurel, MD',
'http://www.prudential.com', 2400),
(163, 'Charter Communications', '802 North Ave, Pittsburgh, PA', 'http://www.charter.com', 3600),
(177, 'United Continental Holdings', '2904 S Salina St, Syracuse, NY',
'http://www.unitedcontinentalholdings.com', 5000),
(180, 'INTL FCStone', '5344 Haverford Ave, Philadelphia, PA', 'http://www.intlfcstone.com', 5000),
(184, 'Publix Super Markets', '1795 Wu Meng, Muang Chonburi, ', 'http://www.publix.com', 1200),
(187, 'ConocoPhillips', 'Walpurgisstr 69, Munich, ', 'http://www.conocophillips.com', 2400),
(190, '3M', 'Via Frenzy 6903, Roma, ', 'http://www.3m.com', 1200),
(192, 'Exelon', 'Via Luminosa 162, Firenze, ', 'http://www.exeloncorp.com', 500),
(195, 'Applied Materials', 'Via Dolorosa 69, Tellaro, ', 'http://www.appliedmaterials.com', 700),
(200, 'Enterprise Products Partners', 'Via Notoriosa 1949, Firenze, ',
'http://www.enterpriseproducts.com', 2400),
(204, 'Rite Aid', 'Piazza Cacchiatore 23, San Giminiano, ', 'http://www.riteaid.com', 3600),
(206, 'Ally Financial', 'Via Notoriosa 1949, Ventimiglia, ', 'http://www.ally.com', 3600),
(207, 'Northwestern Mutual', '1831 No Wong, Peking, ',
'http://www.northwesternmutual.com', 3600),
(208, 'Tesoro', 'Via Notoriosa 1942, Firenze, ', 'http://www.tsocorp.com', 500),
(212, 'Qualcomm', 'Piazza Svizzera, Milano, ', 'http://www.qualcomm.com', 500), (216,
'EMC', 'Via Delle Grazie 11, San Giminiano, ', 'http://www.emc.com', 700),
(218, 'Lennar', '1592 Silverado St, Bangalore, Kar', 'http://www.lennar.com', 700),
(220, 'Time Warner Cable', '1597 Legend St, Mysore, Kar', 'http://www.twc.com', 3700),
(223, 'Northrop Grumman', '1606 Sangam Blvd, New Delhi, ',
'http://www.northropgrumman.com', 5000),
8
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(228, 'Kinder Morgan', '1614 Gitanjali Rd, Calcutta, ', 'http://www.kindermorgan.com', 5000),
(231, 'Molina Healthcare', '1617 Crackers St, Bangalore - India, Kar',
'http://www.molinahealthcare.com', 300),
(235, 'Lincoln National', '1622 Roja St, Chennai, Tam', 'http://www.lfg.com', 5000),
(238, 'C.H. Robinson Worldwide', '1628 Pataudi St, New Delhi, ',
'http://www.chrobinson.com', 1900),
(242, 'Synnex', '1647 Suspense St, Cochin, Ker', 'http://www.synnex.com', 500),
(243, 'Hormel Foods', '1648 Anamika St, Cochin, Ker', 'http://www.hormelfoods.com', 500),
(245, 'HollyFrontier', '1656 Veterans Rd, Chennai, Tam', 'http://www.hollyfrontier.com', 2500),
(249, 'PBF Energy', 'Piazza Quattre Stagioni 4, Roma, ', 'http://www.pbfenergy.com', 3700),
(254, 'PayPal Holdings', 'Via Dello Croce 93, Roma, ', 'http://www.paypal.com', 1200), (255,
'Waste Management', 'Via Di Firenze 231, Roma, ', 'http://www.wm.com', 2400),
(259, 'Parker-Hannifin', 'Canale Grande 2, Roma, ', 'http://www.parker.com', 700),
(263, 'Farmers Insurance Exchange', 'Via Dello Croce 93, Tellaro, ',
'http://www.farmers.com', 100),
(266, 'Autoliv', 'Via Delle Capeletti 52, San Giminiano, ', 'http://www.autoliv.com', 400),
(268, 'VF', '1971 Limelight Blvd, Samutprakarn, ', 'http://www.vfc.com', 1200),
(294, 'Corning', 'Pfannenstilstr 13, Egg, ZH', 'http://www.corning.com', 2300),
(301, 'Univar', '1598 Legend St, Bangalore, Kar', 'http://www.univar.com', 5000),
(313, 'Hertz Global Holdings', '1616 Crackers Blvd, Bangalore - India, Kar', 'http://www.hertz.com',
5000),
(314, 'Thrivent Financial for Lutherans', '1617 Crackers St, Bangalore - India, Kar',
'http://www.thrivent.com', 900),
(319, 'BB&T Corp.', '1668 Chong Tao, Beijing, ', 'http://www.bbt.com', 200);
9
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
INSERT INTO `employees` (`employee_id`, `firstname`, `lastname`, `email`, `phone`, `hiredate`,
`manager_id`, `jobtitle`) VALUES
(1, 'Tommy', 'Bailey', '[email protected]', '515.123.4567', '2016-06-17', NULL, 'President'),
(2, 'Jude', 'Rivera', '[email protected]', '515.123.4568', '2016-09-21', 1,
'Administration Vice President'),
(3, 'Blake', 'Cooper', '[email protected]', '515.123.4569', '2016-01-13', 1, 'Administration Vice
President'),
(4, 'Louie', 'Richardson', '[email protected]', '590.423.4567', '2016-01-03', 3,
'Programmer'),
(5, 'Nathan', 'Cox', '[email protected]', '590.423.4568', '2016-05-21', 4,
'Programmer'),
(6, 'Gabriel', 'Howard', '[email protected]', '590.423.4569', '2016-06-25', 4, 'Programmer'),
(7, 'Charles', 'Ward', '[email protected]', '590.423.4560', '2016-02-05', 4, 'Programmer'),
(8, 'Bobby', 'Torres', '[email protected]', '590.423.5567', '2016-02-07', 4, 'Programmer'),
(9, 'Mohammad', 'Peterson', '[email protected]', '515.124.4569', '2016-0817', 2,
'Finance Manager'),
(10, 'Ryan', 'Gray', '[email protected]', '515.124.4169', '2016-08-16', 9, 'Accountant'),
(11, 'Tyler', 'Ramirez', '[email protected]', '515.124.4269', '2016-09-28', 9, 'Accountant'),
(12, 'Elliott', 'James', '[email protected]', '515.124.4369', '2016-09-30', 9, 'Accountant'),
(13, 'Albert', 'Watson', '[email protected]', '515.124.4469', '2016-03-07', 9, 'Accountant'),
(14, 'Elliot', 'Brooks', '[email protected]', '515.124.4567', '2016-12-07', 9, 'Accountant'),
(15, 'Rory', 'Kelly', '[email protected]', '515.127.4561', '2016-12-07', 1, 'Purchasing Manager'),
(16, 'Alex', 'Sanders', '[email protected]', '515.127.4562', '2016-05-18', 15, 'Purchasing Clerk'),
(17, 'Frederick', 'Price', '[email protected]', '515.127.4563', '2016-12-24', 15, 'Purchasing
Clerk'),
(18, 'Ollie', 'Bennett', '[email protected]', '515.127.4564', '2016-07-24', 15, 'Purchasing Clerk'),
(19, 'Louis', 'Wood', '[email protected]', '515.127.4565', '2016-11-15', 15, 'Purchasing Clerk'),
(20, 'Dexter', 'Barnes', '[email protected]', '515.127.4566', '2016-08-10', 15, 'Purchasing
Clerk'),
(46, 'Ava', 'Sullivan', '[email protected]', '011.44.1344.429268', '2016-10-01', 1, 'Sales
Manager'),
(47, 'Ella', 'Wallace', '[email protected]', '011.44.1344.467268', '2016-01-05', 1, 'Sales
Manager'),
(48, 'Jessica', 'Woods', '[email protected]', '011.44.1344.429278', '2016-03-10', 1, 'Sales
Manager'),
(49, 'Isabella', 'Cole', '[email protected]', '011.44.1344.619268', '2016-10-15', 1, 'Sales
Manager'),
(50, 'Mia', 'West', '[email protected]', '011.44.1344.429018', '2016-01-29', 1, 'Sales Manager'),
10
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(56, 'Evie', 'Harrison', '[email protected]', '011.44.1344.486508', '2016-11-23', 46, 'Sales
Representative'),
(57, 'Scarlett', 'Gibson', '[email protected]', '011.44.1345.429268', '2016-01-30', 47, 'Sales
Representative'),
(58, 'Ruby', 'Mcdonald', '[email protected]', '011.44.1345.929268', '2016-03-04', 47, 'Sales
Representative'),
(101, 'Annabelle', 'Dunn', '[email protected]', '515.123.4444', '2016-09-17', 2,
'Administration Assistant'),
(102, 'Emma', 'Perkins', '[email protected]', '515.123.5555', '2016-02-17', 1, 'Marketing
Manager'),
(103, 'Amelie', 'Hudson', '[email protected]', '603.123.6666', '2016-08-17', 102, 'Marketing
Representative'),
(104, 'Harper', 'Spencer', '[email protected]', '515.123.7777', '2016-06-07', 2, 'Human
Resources Representative'),
(105, 'Gracie', 'Gardner', '[email protected]', '515.123.8888', '2016-06-07', 2, 'Public
Relations Representative'),
(106, 'Rose', 'Stephens', '[email protected]', '515.123.8080', '2016-06-07', 2, 'Accounting
Manager'),
(107, 'Summer', 'Payne', '[email protected]', '515.123.8181', '2016-06-07', 106, 'Public
Accountant');
INSERT INTO `locations` (`location_id`, `address`, `postalcode`, `city`, `state`, `country_id`) VALUES
(
1, '1297 Via Cola di Rie', '00989', 'Roma', NULL, 'IT'),
(2, '93091 Calle della Testa', '10934', 'Venice', NULL, 'IT'),
(3, '2017 Shinjuku-ku', '1689', 'Tokyo', 'Tokyo Prefecture', 'JP'),
(4, '9450 Kamiya-cho', '6823', 'Hiroshima', NULL, 'JP'),
(5, '2014 Jabberwocky Rd', '26192', 'Southlake', 'Texas', 'US'),
(6, '2011 Interiors Blvd', '99236', 'South San Francisco', 'California', 'US'),
(7, '2007 Zagora St', '50090', 'South Brunswick', 'New Jersey', 'US'),
(8, '2004 Charade Rd', '98199', 'Seattle', 'Washington', 'US'),
(9, '147 Spadina Ave', 'M5V 2L7', 'Toronto', 'Ontario', 'CA'),
(10, '6092 Boxwood St', 'YSW 9T2', 'Whitehorse', 'Yukon', 'CA'),
(11, '40-5-12 Laogianggen', '190518', 'Beijing', NULL, 'CN'),
(12, '1298 Vileparle (E)', '490231', 'Bombay', 'Maharashtra', 'IN'),
(13, '12-98 Victoria Street', '2901', 'Sydney', 'New South Wales', 'AU'),
(14, '198 Clementi North', '540198', 'Singapore', NULL, 'SG'),
(15, '8204 Arthur St', NULL, 'London', NULL, 'UK'),
(16, 'Magdalen Centre, The Oxford Science Park', 'OX9 9ZB', 'Oxford', 'Oxford', 'UK'),
16
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(17, '9702 Chester Road', '09629850293', 'Stretford', 'Manchester', 'UK'),
(18, 'Schwanthalerstr. 7031', '80925', 'Munich', 'Bavaria', 'DE'),
(19, 'Rua Frei Caneca 1360 ', '01307-002', 'Sao Paulo', 'Sao Paulo', 'BR'),
(20, '20 Rue des Corps-Saints', '1730', 'Geneva', 'Geneve', 'CH'),
(21, 'Murtenstrasse 921', '3095', 'Bern', 'BE', 'CH'),
(22, 'Pieter Breughelstraat 837', '3029SK', 'Utrecht', 'Utrecht', 'NL'),
(23, 'Mariano Escobedo 9991', '11932', 'Mexico City', 'Distrito Federal,', 'MX');
18
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(7, 1, 227, 74, 305),
(8, 1, 87, 92, 760),
(8, 9, 268, 148, 48),
(9, 1, 108, 139, 850),
(10, 1, 145, 118, 287),
(11, 1, 96, 113, 142),
(12, 1, 191, 41, 574),
(13, 1, 84, 46, 440),
(14, 1, 129, 98, 735),
(15, 1, 287, 60, 330),
(16, 1, 166, 70, 1639),
(17, 1, 149, 51, 283),
(18, 1, 213, 105, 1470),
(19, 1, 38, 53, 1200),
(20, 1, 126, 105, 641),
(21, 1, 36, 79, 1300),
(22, 1, 83, 44, 830),
(23, 1, 202, 104, 714),
(24, 1, 121, 129, 722),
(25, 1, 43, 109, 299),
(26, 1, 200, 114, 621),
(27, 1, 71, 38, 660),
(28, 1, 31, 61, 444), (29, 1,
7, 38, 681),
(30, 1, 235, 70, 42),
(31, 1, 101, 68, 636),
(32, 1, 251, 83, 338),
(33, 1, 55, 93, 151),
(34, 1, 185, 141, 874),
(35, 1, 174, 133, 798), (36, 1,
204, 45, 687),
(37, 1, 35, 150, 1315),
(38, 1, 71, 90, 660),
(39, 1, 186, 116, 1450),
19
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(40, 1, 141, 106, 420),
(41, 1, 268, 80, 48),
(42, 1, 34, 45, 418),
(43, 1, 67, 74, 863),
(44, 1, 220, 118, 760),
(45, 1, 74, 43, 702),
(46, 1, 120, 51, 892),
(47, 1, 178, 73, 2000),
(48, 1, 165, 46, 1667),
(49, 1, 172, 104, 358),
(50, 1, 215, 49, 830),
(51, 1, 21, 34, 750),
(52, 1, 235, 123, 42),
(53, 1, 100, 130, 98),
(54, 1, 208, 73, 1200),
(55, 1, 102, 127, 2043),
(56, 1, 84, 70, 440),
(57, 1, 224, 75, 350),
(58, 1, 64, 55, 526),
(59, 1, 178, 101, 2000),
(60, 1, 205, 74, 650),
(61, 1, 174, 114, 798),
(62, 1, 188, 130, 482),
(63, 1, 70, 72, 711),
(64, 1, 199, 61, 648),
(65, 1, 280, 104, 150),
(66, 1, 77, 143, 696),
(67, 1, 287, 61, 330),
(68, 1, 163, 98, 1900),
(69, 1, 206, 57, 4139),
(70, 1, 185, 146, 874),
(70, 7, 32, 132, 470),
(71, 1, 19, 146, 1704),
(72, 1, 129, 101, 735),
20
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(73, 1, 245, 120, 1699),
(73, 5, 192, 124, 520),
(74, 1, 104, 97, 84),
(74, 7, 27, 92, 801),
(75, 1, 58, 73, 785),
(75, 11, 6, 128, 850),
(76, 1, 109, 92, 714),
(76, 10, 95, 106, 110), (77, 1, 203, 65, 671),
(77, 5, 271, 148, 550),
(78, 1, 92, 147, 2200),
(79, 1, 285, 145, 340),
(80, 1, 213, 63, 1470),
(81, 1, 128, 133, 742),
(81, 7, 79, 127, 660),
(82, 1, 91, 42, 2260),
(82, 9, 284, 138, 55),
(83, 1, 264, 35, 89),
(83, 8, 174, 117, 798),
(84, 1, 106, 137, 609),
(84, 6, 131, 34, 280),
(85, 1, 155, 114, 589),
(86, 1, 202, 46, 714),
(87, 1, 47, 123, 2377),
(87, 11, 271, 58, 550),
(88, 1, 278, 139, 678),
(89, 1, 247, 45, 340),
(90, 1, 65, 84, 1200),
(90, 8, 92, 49, 2200),
(91, 1, 122, 89, 723),
(91, 11, 226, 77, 310),
(92, 1, 208, 114, 1200),
(93, 1, 257, 70, 85),
(93, 5, 121, 141, 722),
(94, 1, 255, 38, 91),
21
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(94, 9, 12, 33, 825),
(95, 1, 52, 138, 1677),
(96, 1, 260, 34, 268),
(97, 1, 110, 39, 3193),
(98, 1, 66, 104, 400), (99, 1, 95, 66, 110),
(99, 9, 17, 144, 699),
(100, 1, 280, 70, 150),
(101, 1, 17, 47, 699),
(102, 1, 196, 69, 1100),
(102, 3, 247, 149, 340),
(103, 1, 6, 117, 850),
(104, 1, 129, 74, 735),
(104, 7, 178, 145, 2000),
(105, 1, 31, 116, 444), (105, 6,
183, 79, 900);
22
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(9, 'Intel Xeon E5-2640 V4', 'Speed:2.4GHz,Cores:10,TDP:90W', 739, 900, 1),
(11, 'PNY VCQP5000-PB', 'Chipset:Quadro P5000,Memory:16GBCore Clock:1.61GHz', 1602, 2015,
2),
(12, 'Gigabyte GV-N108TAORUSX W-11GD', 'Chipset:GeForce GTX 1080 Ti,Memory:11GBCore
Clock:1.63GHz', 596, 825, 2),
(16, 'Intel Core i7-6900K', 'Speed:3.2GHz,Cores:8,TDP:140W', 793, 890, 1),
(19, 'Intel Core i7-6950X (OEM/Tray)', 'Speed:3.0GHz,Cores:10,TDP:140W', 1480, 1704, 1), (27,
'Intel Core i7-3960X Extreme Edition', 'Speed:3.3GHz,Cores:6,TDP:130W', 573, 801, 1),
(45, 'Intel Xeon E5-2685 V3 (OEM/Tray)', 'Speed:2.6GHz,Cores:12,TDP:120W', 2012, 2502, 1),
(46, 'Intel Xeon E5-2695 V3 (OEM/Tray)', 'Speed:2.3GHz,Cores:14,TDP:120W', 1925, 2432, 1), (47,
'Intel Xeon E5-2697 V2', 'Speed:2.7GHz,Cores:12,TDP:130W', 2102, 2377, 1),
(48, 'AMD FirePro S7000', 'Chipset:FirePro S7000,Memory:4GBCore Clock:950MHz', 936, 1219, 2),
(51, 'Intel Xeon E5-2695 V4', 'Speed:2.1GHz,Cores:18,TDP:120W', 1780, 2270, 1),
(52, 'Intel Xeon E5-2670 V3', 'Speed:2.3GHz,Cores:12,TDP:120W', 1454, 1677, 1),
(53, 'Intel Core 2 Extreme QX6800', 'Speed:2.93GHz,Cores:4,TDP:100W', 788, 1004, 1),
(54, 'Intel Xeon E5-1660 V3 (OEM/Tray)', 'Speed:3.0GHz,Cores:8,TDP:140W', 915, 1020, 1),
(59, 'Intel Core i7-5960X (OEM/Tray)', 'Speed:3.0GHz,Cores:8,TDP:140W', 880, 978, 1),
(69, 'Intel Core i7-7820X', 'Speed:3.6GHz,Cores:8,TDP:140W', 511, 679, 1),
(70, 'Intel Xeon E5-2687W', 'Speed:3.1GHz,Cores:8,TDP:150W', 581, 711, 1),
(71, 'Intel Core i7-3930K', 'Speed:3.2GHz,Cores:6,TDP:130W', 509, 660, 1),
(72, 'Intel Xeon E5-2630 V3 (OEM/Tray)', 'Speed:2.4GHz,Cores:8,TDP:85W', 422, 590, 1),
(73, 'Intel Core i7-4770K', 'Speed:3.5GHz,Cores:4,TDP:84W', 714, 799, 1),
(74, 'Intel Xeon E5-2680 V2', 'Speed:2.8GHz,Cores:10,TDP:115W', 568, 702, 1),
(75, 'Intel Core i7-4930K', 'Speed:3.4GHz,Cores:6,TDP:130W', 528, 624, 1),
(76, 'Intel Xeon E5-2630 V3', 'Speed:2.4GHz,Cores:8,TDP:85W', 500, 630, 1),
(80, 'Intel Xeon E5-1650 V3', 'Speed:3.5GHz,Cores:6,TDP:140W', 400, 565, 1),
(81, 'Intel Xeon E5-2650 V4', 'Speed:2.2GHz,Cores:12,TDP:105W', 945, 1100, 1),
(82, 'Intel Core i7-6950X', 'Speed:3.0GHz,Cores:10,TDP:140W', 1053, 1500, 1),
(83, 'Asus STRIX-GTX1080TI-O11G-GAMING', 'Chipset:GeForce GTX 1080
Ti,Memory:11GBCore Clock:1.57GHz', 691, 830, 2),
(85, 'Intel Xeon E5-2660 V3 (OEM/Tray)', 'Speed:2.6GHz,Cores:10,TDP:105W', 902, 1275, 1), (91,
'Intel Xeon E5-2695 V2', 'Speed:2.4GHz,Cores:12,TDP:115W', 1794, 2260, 1),
(92, 'Intel Xeon E5-2643 V2 (OEM/Tray)', 'Speed:3.5GHz,Cores:6,TDP:130W', 1940, 2200, 1),
(93, 'Intel Xeon E5-2690 (OEM/Tray)', 'Speed:2.9GHz,Cores:8,TDP:135W', 1888, 2117, 1), (98, 'Intel
Xeon E5-2687W V3', 'Speed:3.1GHz,Cores:10,TDP:160W', 1781, 2065, 1),
23
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(102, 'Intel Xeon E5-2687W V4', 'Speed:3.0GHz,Cores:12,TDP:160W', 1724, 2043, 1),
(105, 'EVGA 12G-P4-3992-KR', 'Chipset:GeForce GTX Titan Z,Memory:12GBCore Clock:732MHz',
2313, 2800, 2),
(106, 'Intel Xeon E5-2640 V2', 'Speed:2.0GHz,Cores:8,TDP:95W', 545, 609, 1),
(108, 'MSI GAMING', 'Chipset:GeForce GTX 780 Ti,Memory:3GBCore Clock:1.02GHz', 753, 850, 2),
(110, 'ATI FirePro W9000', 'Chipset:FirePro W9000,Memory:6GBCore Clock:975MHz', 2786, 3193,
2),
(111, 'Intel Core i7-6900K (OEM/Tray)', 'Speed:3.2GHz,Cores:8,TDP:140W', 620, 827, 1),
(114, 'Zotac ZT-70203-10P', 'Chipset:GeForce GTX 780,Memory:3GBCore Clock:1.01GHz', 580, 821,
2),
(119, 'Intel Xeon E5-2640 V3', 'Speed:2.6GHz,Cores:8,TDP:90W', 668, 900, 1),
(120, 'Intel Core 2 Extreme QX9775', 'Speed:3.2GHz,Cores:4,TDP:150W', 738, 892, 1),
(123, 'ATI FirePro S9150', 'Chipset:FirePro S9150,Memory:16GBCore Clock:900MHz', 2628, 3177, 2),
(124, 'Intel Xeon E5-1650 V4 (OEM/Tray)', 'Speed:3.6GHz,Cores:6,TDP:140W', 453, 595, 1),
(132, 'Intel Core i7-5930K', 'Speed:3.5GHz,Cores:6,TDP:140W', 482, 555, 1),
(133, 'PNY VCQP6000-PB', 'Chipset:Quadro P6000,Memory:24GBCore Clock:1.42GHz', 4059, 5500,
2),
(136, 'AMD Opteron 6378', 'Speed:2.4GHz,Cores:16,TDP:115W', 652, 827, 1),
(142, 'AMD FirePro W9100', 'Chipset:FirePro W9100,Memory:16GBCore Clock:930MHz', 2483, 2999,
2),
(153, 'Intel Xeon E5-2650 V2', 'Speed:2.6GHz,Cores:8,TDP:95W', 961, 1249, 1),
(154, 'Intel Xeon E5-2650 V3', 'Speed:2.3GHz,Cores:10,TDP:105W', 907, 1205, 1),
(155, 'Intel Xeon E5-2630 V2', 'Speed:2.6GHz,Cores:6,TDP:80W', 493, 589, 1),
(158, 'Intel Xeon E5-2667 V3 (OEM/Tray)', 'Speed:3.2GHz,Cores:8,TDP:135W', 1504, 2009, 1),
(159, 'Intel Xeon E5-2690 V4', 'Speed:2.6GHz,Cores:14,TDP:135W', 1499, 1994, 1),
(160, 'Intel Xeon E5-2690 V3', 'Speed:2.6GHz,Cores:12,TDP:135W', 1540, 1909, 1),
(161, 'AMD 100-5056062', 'Chipset:Vega Frontier Edition Liquid,Memory:16GBCore Clock:1.5GHz',
1344, 1500, 2),
(162, 'Intel Xeon E5-2470V2', 'Speed:2.4GHz,Cores:10,TDP:95W', 1672, 1905, 1),
(163, 'Intel Xeon E5-2683 V4', 'Speed:2.1GHz,Cores:16,TDP:120W', 1707, 1900, 1),
(164, 'Intel Xeon E5-2637 V2 (OEM/Tray)', 'Speed:3.5GHz,Cores:4,TDP:130W', 1323, 1850, 1),
(165, 'Intel Xeon E5-2680', 'Speed:2.7GHz,Cores:8,TDP:130W', 1480, 1667, 1),
(166, 'Intel Xeon E5-2680 V3 (OEM/Tray)', 'Speed:2.5GHz,Cores:12,TDP:120W', 1167, 1639, 1),
(167, 'Intel Xeon E5-2650L V3 (OEM/Tray)', 'Speed:1.8GHz,Cores:12,TDP:65W', 779, 1010, 1),
(169, 'Intel Xeon E5-2683 V4 (OEM/Tray)', 'Speed:2.1GHz,Cores:16,TDP:120W', 1370, 1845, 1),
(176, 'Intel Xeon E5-2650 V3 (OEM/Tray)', 'Speed:2.3GHz,Cores:10,TDP:105W', 800, 939, 1),
24
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(177, 'PNY VCQM5000-PB', 'Chipset:Quadro M5000,Memory:8GBCore Clock:861MHz', 1268, 1760,
2),
(178, 'HP C2J95AT', 'Chipset:Quadro K5000,Memory:4GBCore Clock:706MHz', 1716, 2000, 2),
(181, 'ATI FirePro R5000', 'Chipset:FirePro R5000,Memory:2GBCore Clock:825MHz', 761, 1000, 2),
(182, 'PNY VCQK4200-PB', 'Chipset:Quadro K4200,Memory:4GBCore Clock:771MHz', 799, 950, 2),
(183, 'Asus GTX780TI-3GD5', 'Chipset:GeForce GTX 780 Ti,Memory:3GBCore Clock:876MHz', 782,
900, 2),
(184, 'AMD 100-506061', 'Chipset:Vega Frontier Edition,Memory:16GBCore Clock:1.44GHz', 707,
1000, 2),
(185, 'MSI GTX 1080 TI LIGHTNING Z', 'Chipset:GeForce GTX 1080 Ti,Memory:11GBCore
Clock:1.61GHz', 688, 874, 2),
(186, 'PNY VCQK5200-PB', 'Chipset:Quadro K5200,Memory:8GBCore Clock:667MHz', 1129, 1450,
2),
(198, 'Intel Core i7-980', 'Speed:3.33GHz,Cores:6,TDP:130W', 564, 700, 1),
(199, 'Intel Xeon E5-2630 V4', 'Speed:2.2GHz,Cores:10,TDP:85W', 529, 648, 1),
(200, 'Intel Core i7-4790K', 'Speed:4.0GHz,Cores:4,TDP:88W', 462, 621, 1),
(206, 'PNY VCQM6000-24GB-PB', 'Chipset:Quadro M6000,Memory:24GBCore Clock:988MHz', 3619,
4139, 2),
(207, 'PNY VCQM6000-PB', 'Chipset:Quadro M6000,Memory:12GBCore Clock:988MHz', 2505, 3255,
2),
(209, 'Intel Core i7-990X Extreme Edition', 'Speed:3.47GHz,Cores:6,TDP:130W', 1073, 1200, 1),
(210, 'Intel Core i9-7900X', 'Speed:3.3GHz,Cores:10,TDP:140W', 856, 1030, 1),
(211, 'Intel Xeon E5-2650', 'Speed:2.0GHz,Cores:8,TDP:95W', 869, 1065, 1),
(212, 'Intel Xeon E5-2680 V4', 'Speed:2.4GHz,Cores:14,TDP:120W', 1365, 1640, 1),
(213, 'Intel Xeon E5-2643 V3 (OEM/Tray)', 'Speed:3.4GHz,Cores:6,TDP:135W', 1266, 1470, 1), (214,
'Intel Core i7-5960X', 'Speed:3.0GHz,Cores:8,TDP:140W', 866, 1010, 1),
(215, 'PNY VCQP4000-PB', 'Chipset:Quadro P4000,Memory:8GBCore Clock:1.23GHz', 724, 830, 2),
(216, 'MSI GTX 1080 TI LIGHTNING X', 'Chipset:GeForce GTX 1080 Ti,Memory:11GBCore
Clock:1.57GHz', 743, 864, 2),
(218, 'Intel Xeon E5-2660 V4', 'Speed:2.0GHz,Cores:14,TDP:105W', 1194, 1389, 1),
(219, 'Intel Xeon E5-2660 V3', 'Speed:2.6GHz,Cores:10,TDP:105W', 1042, 1300, 1),
(228, 'Intel Xeon E5-2699 V3 (OEM/Tray)', 'Speed:2.3GHz,Cores:18,TDP:145W', 2868, 3410, 1),
(240, 'Intel Core i7-4960X Extreme Edition', 'Speed:3.6GHz,Cores:6,TDP:130W', 1496, 1806, 1),
(241, 'Intel Xeon E5-2699 V4 (OEM/Tray)', 'Speed:2.2GHz,Cores:22,TDP:145W', 1536, 1756, 1),
(242, 'Intel Xeon E5-1680 V3 (OEM/Tray)', 'Speed:3.2GHz,Cores:8,TDP:140W', 1520, 1752, 1),
(243, 'Intel Xeon E5-2643 V4 (OEM/Tray)', 'Speed:3.4GHz,Cores:6,TDP:135W', 1226, 1709, 1),
(245, 'ATI FirePro S9050', 'Chipset:FirePro S9050,Memory:12GBCore Clock:900MHz', 1237, 1699, 2),
25
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
(248, 'Intel Xeon E5-2697 V3', 'Speed:2.6GHz,Cores:14,TDP:145W', 2326, 2775, 1),
(249, 'Intel Xeon E5-2698 V3 (OEM/Tray)', 'Speed:2.3GHz,Cores:16,TDP:135W', 2035, 2661, 1),
(267, 'EVGA 12G-P4-1999-KR', 'Chipset:GeForce GTX Titan
X,Memory:12GBCore Clock:1.15GHz', 1328, 1800, 2),
(281, 'Asus ROG-POSEIDON-GTX1080TI-P11G-GAMING', 'Chipset:GeForce GTX 1080
Ti,Memory:11GBCore Clock:1.62GHz', 696, 865, 2);
26
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
27
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
ALTER TABLE `order_items`
ADD PRIMARY KEY (`order_id`,`item_id`);
28
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
29
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
C)
Alter
Column of Table
(1) Add column “salary” in 0employee_m table
having data type integer and not null .
31
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
32
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
33
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
34
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
35
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
36
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
3. select distinct job titles from employee
table.
37
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
39
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
40
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
41
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
42
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
44
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
expressed as a whole number. Label the
column New Price.
45
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
46
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
47
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
48
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
49
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
50
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
51
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
• Simple meaning of rollback is just to revert the
operation with the last performed operation.
52
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
53
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
54
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
•
We observe that insert statement get rollback, but if
we commit the transaction then insert statement not
get affected by rollback instruction.
55
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
56
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
•
Use it for fetch the data from the table just replace
the table name with view name. For that use “create
view” keyword.
57
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
58
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
•
Named blocks are basically of two types :
1. Procedure
2. Function Examples
are :
59
12202040501008 Anshita Shah
DATABASE MANAGEMENT SYSTEM - 202040302
60
12202040501008 Anshita Shah
202030402 Akshat Mistry 12202040501006
• For ex.:
delimiter //
• Case statement :
• Leave Statement :
• Leave statement work as continue statement ,
mostly use for terminate the condition by putting
specific condition .
202030402 Akshat Mistry 12202040501006
Queries :
DELIMITER //
• Read-only: you cannot update data in the underlying table through the cursor.
• Non-scrollable: you can only fetch rows in the order determined by the SELECT
statement. You cannot fetch rows in the reversed order. In addition, you cannot skip
rows or jump to a specific row in the result set.
• Asensitive: there are two kinds of cursors: a sensitive cursor and insensitive cursor.
An asensitive cursor points to the actual data, whereas an insensitive cursor uses a
temporary copy of the data. A sensitive cursor performs faster than an insensitive
cursor because it does not have to make a temporary copy of data. However, any
change that is made to the data from other connections will affect the data that is being
used by a sensitive cursor, therefore, it is safer if you do not update the data that is
being used by an a sensitive cursor. MySQL cursor is asensitive.
The cursor declaration must be after any variable declaration. If you declare a cursor before
the variable declarations, MySQL will issue an error. A cursor must always be associated
with a SELECT statement.
Next, open the cursor by using the OPEN statement. The OPEN statement initializes the
result set for the cursor, therefore, you must call the OPEN statement before fetching rows
from the result set.
OPEN cursor_name;
Then, use the FETCH statement to retrieve the next row pointed by the cursor and move the
cursor to the next row in the result set.
After that, check if there is any row available before fetching it.
Finally, deactivate the cursor and release the memory associated with it using the CLOSE
statement:
CLOSE cursor_name;
When working with MySQL cursor, you must also declare a NOT FOUND handler to handle
the situation when the cursor could not find any row.
Because each time you call the FETCH statement, the cursor attempts to read the next row in
the result set. When the cursor reaches the end of the result set, it will not be able to get the
data, and a condition is raised. The handler is used to handle this condition.
The finished is a variable to indicate that the cursor has reached the end of the result set.
Notice that the handler declaration must appear after variable and cursor declaration inside
the stored procedures.
Example :
202030402 Akshat Mistry 12202040501006
Example 2:
202030402 Akshat Mistry 12202040501006
• Types of Cursors:
202030402 Akshat Mistry 12202040501006
Non-Scrollable (Forward-Only) Cursor:
This type of cursor allows you to traverse the result set
only in the forward direction, from the first to the last
row.
It does not support backward movement or random access to
rows .
• Another example :
Scrollable Cursor:
Example :
202030402 Akshat Mistry 12202040501006
Example 2:
202030402 Akshat Mistry 12202040501006