Posts

assignmen sql 1

-- a -> CREATE the tables with appropriate constraints CREATE Table Student( Stud_Id INT PRIMARY KEY, Stud_Name VARCHAR(10) ); CREATE Table Membership( Mem_no INT PRIMARY KEY, Stud_Id INT, FOREIGN KEY(Stud_Id) REFERENCES Student(Stud_Id) on delete CASCADE ); CREATE Table Book( book_no INT PRIMARY KEY, book_name VARCHAR(10), author_name VARCHAR(10) ); CREATE Table IssueRec( iss_no INT PRIMARY KEY, iss_date DATE, mem_no INT, book_no INT, FOREIGN KEY(mem_no) REFERENCES Membership(Mem_no) on delete CASCADE, FOREIGN KEY(book_no) REFERENCES Book(book_no) on DElete CASCADE ); -- b -> Insert around 10 records INSERT INTO student VALUES (1,"Harsh"); INSERT INTO student VALUES (2,"Rohit"); INSERT INTO student VALUES (3,"Anju"); INSERT INTO student VALUES (4,"Tushar"); INSERT INTO student VALUES (5,"Aman"); INSERT INTO student VALUES (6,"Sonali"); INSERT INTO student VALUES (...

Library_database

CREATE Table student( stud_no INT PRIMARY KEY, stud_name VARCHAR(20) ); CREATE Table membership( Mem_no INT PRIMARY KEY, stud_no INT, FOREIGN KEY (stud_no) REFERENCES student(stud_no) on delete set NULL ); CREATE Table Book( book_no int PRIMARY KEY, book_name VARCHAR(20), author VARCHAR(15) ); CREATE Table iss_rec( iss_no INT PRIMARY key AUTO_INCREMENT, iss_data DATE , mem_no int , book_no int, FOREIGN KEY (mem_no) REFERENCES membership(Mem_no) on delete set NULL, FOREIGN KEY (book_no) REFERENCES Book(book_no) on delete set NULL ); SELECT * FROM student; SELECT * FROM membership; SELECT * FROM book; SELECT * FROM iss_rec; INSERT INTO student VALUES (1, "Harsh Prasad"); INSERT INTO student VALUES (2, "Rihana "); INSERT INTO student VALUES (3, "Love Kush"); INSERT INTO student VALUES (4, "Jiten Kapoor"); INSERT INTO student VALUES (5, "Anju Kumari"); INSERT INTO student VALUES (6,...

DataBase Company Employee

CREATE Table Employee( emp_id INT PRIMARY KEY , first_name VARCHAR(10), second_name VARCHAR(10), dob DATE , sex VARCHAR(1), salary int , supervi_Id int, branch_id int ); CREATE table Branch( branch_id int PRIMARY KEY, branch_name VARCHAR(10), mngr_id int, mngr_strt_date date, FOREIGN KEY (mngr_id) REFERENCES employee(emp_id) on delete set null ); CREATE Table client( clientId int PRIMARY key, client_name VARCHAR(10), branch_id int, FOREIGN KEY(branch_id) REFERENCES Branch(branch_id) on delete set null ); CREATE Table Works_with( emp_id INT, clientId int, total_sales int -- PRIMARY key(emp_id, clientId), -- FOREIGN key(emp_id) REFERENCES employee(emp_id) on delete CASCADE, -- FOREIGN key(clientId) REFERENCES client(clientId) on delete CASCADE ); CREATE Table Branch_Suppliers( branch_id int , supplier_name VARCHAR(15), supply_type VARCHAR(15), PRIMARY key (branch_id, supplier_name...

Insert and delete item in a BST

  #include   <stdio.h> #include   <stdlib.h> struct   tree {      int   data ;      struct   tree   * left ;      struct   tree   * right ; }; int   arr [ 9 ],  i   =   0 ; struct   tree   * Createnode ( int   data ) {      struct   tree   * nd   =  ( struct   tree   * ) malloc ( sizeof ( struct   tree ));      nd -> left   =   NULL ;      nd -> right   =   NULL ;      nd -> data   =   data ;      return   nd ; } void   inOrderTraversal ( struct   tree   * root ) {      if  ( root   !=   NULL )     {          inOrderTraversal ( root -> left );  ...

Second source code of HTML

  <!DOCTYPE  html > <html  lang= "en" > <head>      <meta  charset= "UTF-8" >      <meta  http-equiv= "X-UA-Compatible"  content= "IE=edge" >      <meta  name= "description"  content= "width=device-width, initial-scale=1.0" >      <title> My Blog </title>      <style>          #main-header {              text-align :  center ;              background-color :  black ;              color :  white ;              padding :  10 px ;         }   ...

Basic source code of html for begginer

  <!DOCTYPE  html > <html> <head>      <title> Forgings </title> </head> <body>      <a  href= "blog.html" > My Blog </a>      <!-- Headings -->      <h1> Heading One </h1>      <h2> Heading One </h2>      <h3> Heading One </h3>      <!-- Paragraphs -->      <p> Lorem ipsum dolor sit amet consectetur adipisicing elit. Non reprehenderit quis labore veniam         quia odio, neque porro excepturi  <strong> error similique accusantium in rerum </strong>  nisi quae repellendus     ...

Height of the Tree.

  Below is the source code of checking the height of the binary tree. If you need any explanation then please feel free to contact me on my email i.e harshprasadaju@gmail.com. Thankyou. #include   <stdio.h> #include   <stdlib.h> struct   tree {      int   data ;      struct   tree   * left ;      struct   tree   * right ; }; struct   tree   * Createnode ( int   data ) {      struct   tree   * nd   =  ( struct   tree   * ) malloc ( sizeof ( struct   tree ));      nd -> left   =   NULL ;      nd -> right   =   NULL ;      nd -> data   =   data ;      return   nd ; } void   inOrderTraversal ( struct   tree   * root ) {      if  ( root   != ...