QURIES.txt - Microsoft Windows[Version 10.0.16299.248(c...

Info icon This preview shows pages 1–3. Sign up to view the full content.

Microsoft Windows [Version 10.0.16299.248] (c) 2017 Microsoft Corporation. All rights reserved. C:\Users\awais>cd.. C:\Users>cd. C:\Users>cd.. C:\>cd xampp C:\xampp>cd mysql C:\xampp\mysql>cd bin C:\xampp\mysql\bin>mysql -u root -p -h 127.0.0.1 Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 10.1.19-MariaDB mariadb.org binary distribution Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> show databases -> ; +--------------------+ | Database | +--------------------+ | information_schema | | management | | mysql | | performance_schema | | phpmyadmin | | test | +--------------------+ 6 rows in set (0.00 sec) MariaDB [(none)]> show MANAGEMENT; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MANAGEMENT' at line 1 MariaDB [(none)]> describe MANAGEMENT; ERROR 1046 (3D000): No database selected MariaDB [(none)]> use MANAGEMENT; Database changed MariaDB [MANAGEMENT]> show MANAGEMENT; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'MANAGEMENT' at line 1 MariaDB [MANAGEMENT]> describe MANAGEMENT; ERROR 1146 (42S02): Table 'management.management' doesn't exist MariaDB [MANAGEMENT]> show tables; +----------------------+ | Tables_in_management | +----------------------+ | customer | | employee | | eventplan | | eventplanline | | eventrequest | | facility | | location |
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

| resourcetbl | +----------------------+ 8 rows in set (0.00 sec) MariaDB [MANAGEMENT]> insert into FACILITY -> ; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 MariaDB [MANAGEMENT]> insert into FACILITY (FACNO,FACNAME) -> values ('F105','Swimmingpool'); Query OK, 1 row affected (0.00 sec) MariaDB [MANAGEMENT]> SELECT * FROM FACILITY; +-------+------------------+ | FACNO | FACNAME | +-------+------------------+ | F100 | Football stadium | | F101 | Basketball arena | | F102 | Baseball field | | F103 | Recreation room | | F105 | Swimmingpool | +-------+------------------+ 5 rows in set (0.00 sec) MariaDB [MANAGEMENT]> insert into LOCATION (LACNO,FACNO,LONAME) -> values('L109','F109','DOOR'); ERROR 1054 (42S22): Unknown column 'LACNO' in 'field list' MariaDB [MANAGEMENT]> insert into LOCATION (LOCNO,FACNO,LONAME) -> values('L109','F109','DOOR'); ERROR 1054 (42S22): Unknown column 'LONAME' in 'field list' MariaDB [MANAGEMENT]> insert into LOCATION (LACNO,FACNO,LOCNAME) -> values('L109','F109','DOOR'); ERROR 1054 (42S22): Unknown column 'LACNO' in 'field list' MariaDB [MANAGEMENT]> insert into LOCATION (LOCNO,FACNO,LOCNAME) -> values('L109','F109','DOOR'); ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`management`.`location`, CONSTRAINT `location_ibfk_1` FOREIGN KEY (`FACNO`) REFERENCES `facility` (`FACNO`)) MariaDB [MANAGEMENT]> insert into LOCATION (LOCNO,FACNO,LOCNAME) VALUES('L109','F109','DOOR'); ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`management`.`location`, CONSTRAINT `location_ibfk_1` FOREIGN KEY (`FACNO`) REFERENCES `facility` (`FACNO`)) MariaDB [MANAGEMENT]> select * from LOCATION; +-------+-------+-----------------+ | LOCNO | FACNO | LOCNAME | +-------+-------+-----------------+ | L100 | F100 | Locker room | | L101 | F100 | Plaza | | L102 | F100 | Vehicle gate | | L103 | F101 | Locker room | | L104 | F100 | Ticket Booth | | L105 | F101 | Gate | | L106 | F100 | Pedestrian gate | +-------+-------+-----------------+ 7 rows in set (0.00 sec) MariaDB [MANAGEMENT]> insert into LOCATION (LOCNO,FACNO,LOCNAME) -> VALUES('L107','F104','DOOR');
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '17
  • Mr.Ishaq Raza
  • Management, MYSQL , Foreign key, Articles with example SQL code, MariaDB

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern