image/svg+xml       
#import "tpl.typ": *
#import "@preview/tablex:0.0.6": tablex, vlinex, hlinex, colspanx
#show: body => apply(body)
#let semibold(body) = text(weight: 600, body)
#text(size: 1.3em, align(center)[#semibold[Practical Assignments] \ _for_ \ #semibold[RDBMS Lab] \ _using_ \ #semibold[MySQL and PHP]])
#set enum(full: true, numbering: (..args) => {
  let patterns = ("1.", "(a)")
  let pattern = patterns.at(calc.min(args.pos().len(), patterns.len()) - 1)
  numbering(pattern, args.pos().last())
})

#set raw(lang: "php")

+ Create a table `Student` containing the fields `name`, `roll`, `city`, `email` and `date_of_birth`. Then, 
  - Create a form to insert records into this table (and insert at least 5 of them),
  - Display all of the records,
  - Display records of those students who were born in between `01/01/2000` to `31/12/2005`, and
  - Take a valid E-mail address from the user, search for the student with the E-mail address and display the details of the student.
+ Design a `Login` table to take `username` and `password`, and
  - Show all records of the `Student` table for an authorized user, whose username and password exists in the `Login` table.
  - Allow the authenticated users to change their username and password.
+ Suppose a table `Food_Details` containing the fields `Food_items` and `Price_per_item`. Create another table `Customer_details` containing the fields `customer_name`, `total_amount_paid`, `date_of_payment`. Design a menu to select different food items and input the quantity ordered by customer. Generate a bill containing Customer name, Food items, quantity, and Total price. Also insert the record i.e. customer name, total amount paid and date of payment in `Customer_details` table. Net price should be the total price plus 15% GST of total price.
+ Suppose a table `Salary` contained the fields `EmpName`, `BasicPay`, `HRA`, `DA` and `Professional_tax`. Record should exists only for `EmpName` and `BasicPay`. Design a HTML form to take input for HRA percentage, DA percentage, and Professional tax. Now write a PHP script to generate the DA, HRA and Professional tax of every employee and store them into Salary table with respect to every employee. Now display the records.
+ Design a HTML form to take inputs from user and store the records into a table `Employee` using PHP script containing the following fields.
  #align(center, tablex(
    columns: 2,
    auto-lines: false,
    hlinex(),
    vlinex(), vlinex(), vlinex(),
    [*Fields*], [*Form input control*],
    hlinex(),
    [`Ename`], [textbox],
    [`Address`], [textarea],
    [`Phno`], [textbox],
    [`Salary`], [textbox],
    [`Category` \ (out of GEN, SC, ST, OBC)], [radio buttons],
    [`Language`], [checkbox],
    hlinex(),
  ))
  (Multiple languages have to be concatenate into a string separated by commas and then store into database like `Bengali, English, Hindi`.)
+ Write a PHP script to display the employee records of the above `Employee` table order by user’s choice field. The field have to be choices through drop down menu containing all fields of the table.
+ Create a table `Sports` in MySQL database containing the fields `Players`, `TestRuns`, `ODIRuns`, `T20IRuns`. Insert and display the record with total individual runs of every player (like `TestRun + ODIRun + T20IRun`) using PHP.
+ Display the record of highest run scorer in Test or T20I or ODI according to user’s choice through a drop down menu for the table in Question 13. Drop down menu contains the fields name `TestRuns`, `ODIRuns`, `T20IRuns`.
+ Design a HTML form to take records from user for the above table `Sports`. Now write PHP script to insert, update and delete records through PHP script.
+ Design a form to take input from user and store into a table containing the fields `name`, `city`, `phno`, `email`, `password`. Write a PHP script to take input and store into the table such that Phno and mail id of every person must be unique.
+ Create a MySQL database table `Employee` with fields `ename`, `eid`, `salary`, `dept` and `dob`. Perform all database operations like select, insert, delete and update through PHP.
+ Create a table `Marks` with the fields `stdname`, `roll`, `CompScMarks`, `PhysicsMarks`, `ChemistryMarks`. Design a form to insert records into database and display records with grade using PHP script.
  #align(center, tablex(
    columns: (8em, 4em),
    auto-lines: false,
    align: center + horizon,
    colspanx(2)[$ m = ""$average marks of all subjects.],
    hlinex(),
    vlinex(start: 1), vlinex(start: 1), vlinex(start: 1),
    [*Marks*], [*Grade*],
    hlinex(),
    [$80 <= m <= 100$], [A],
    [$60 <= m < 80$], [B],
    [$40 <= m < 60$], [C],
    [$0 <= m < 40$], [D],
    hlinex(),
  ))
+ Create MySQL database table `Dept` with field `dno`, `dname` where `dno` is the primary key. Create another table `Employee` with field `eno`, `ename`, `city`, `salary`, `join_date`, `dno` where `eno` is the primary key and `dno` is a foreign key reference to the `Dept` table. Include other constraints like `NOT NULL`, `CHECK` etc. Perform all database operation like select, insert, update, and delete using PHP. (Query may include `group by`, `having`, `order by`, aggregate functions, `like` operator.)
;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" xml:space="preserve">W show log w show back-ground tasks Q quit q close tab TAB prev. tab tab next tab ~ ` openbookmarks ! :shell 1 (1) ESC abort T t tag files Y y yank (3) U u undo ^U move uphalf page I i inspect file :rename(insert) O o sort P p paste (3) { [ move up inparent dir } traverse sub-directories ] move downin parent dir @ :shell %s 2 (1) # :shell -p 3 (1) $ 4 (1) % 5 (1) ^ 6 (1) & 7 (1) * 8 (1) ( 9 (1) ) 0 (1) _ - chmod (2) + chmod (2) = chmod (2) A :rename(append) a :rename (skipextension) S open shell s :shell D d cut (3) (4) move downhalf page ^D F f :find ^F move downone page G go to top g :cd ... H back inhistory h go up 1directory ^H togglehidden files J move downhalf page j move down K move uphalf page k move up L forward inhistory l enter dir/open file ^L redraw : console ; console ' openbookmarks " tag files withcustom tag CAPSLOCK SHIFT Z ZZ/ZQ = quit z toggleoptions X x ^C C c select files incertain order abort task V visual mode v invertselection B b ^B move upone page N searchprevious n search next ^N new tab M change (5)linemode m savebookmark < , > . ? show help (6) / :search F1 help F3 inspect file F4 edit F5 copy F6 cut F7 :mkdir F8 :delete F10 quit F2 F9 F11 F12 ranger cheatsheet https://ranger.github.io git clone https://github.com/ranger/ranger Macros can be used in commands. They are likeglobal variables with dynamic content: %f%d%s%t%c%any %rangerdir%space The base name of the current fileThe path of the current directoryThe names of the currently selected filesThe names of all tagged files in this directoryThe paths of the currently copied filesThe key used in a key binding with "<any>"Example: map x<any> shell -w echo %anyThe path to the ranger python moduleJust a space, to avoid typing trailing spaces Example: map yp shell echo %d/%f | xsel -iThey can be escaped by replacing % with %%. (1) numbers can be used as a quantifier in various commands, for example 5j will movethe cursor down 5 by lines, 3<space> selects 3 files, 4<TAB> moves you to the 4th tab.(2) the keys -, + and = change the permissions of files. See "man chmod". [+-][augo][rwxXst] (e.g. +gw means "add write permissions to the group) [+-][rwxXst] (e.g. -x means "remove execute permissions from everybody") <octal>= (e.g. 777= means "give full permissions to everybody")(3) yank, copy, paste: To copy files, select them with the cursor (or <space>, in case ofmultiple files) → type dd (to cut) or yy (to copy) → move to the destination → type pp.Type da (or ya) to add files to the copy buffer, allowing you to copy from multiple folders.(4) d also starts the key bindings dc (calculate size of the content of a directory), du/dU(calculate directory size with the "du" program), dD (open the console with ":delete")(5) M<key> changes the linemode - the way files are drawn. Mf draws just the file name,Mp draws permissions, Mi draws file type information, Mt draws metadata, as definedwith the :meta command. You can add custom linemodes as described in/usr/share/doc/ranger/examples/plugin_linemode.py(6) ? starts the key bindings m (man page), k (key bindings), c (commands), s (settings) Config files: run "ranger --copy-config=all" tocopy the default config files to ~/.config/ranger/. rc.conf: A list of commands that are executed when rangerstarts. Options, key bindings and aliases are found here.Pro tip: Adding "export RANGER_LOAD_DEFAULT_RC=FALSE" toyour shell rc will skip loading the default rc.conf before your own.commands.py: A python script containing custom commandsrifle.conf: Rules for rifle, the file opener. Each line looks like list of conditions = commandWhen ranger opens a file, it tests those conditions. The firstcommand where all conditions are true will be executed.scope.sh: The script that generates file previews.Plugins can be put in the plugins/ subdirectory, colorschemesin colorschemes/. See /usr/share/doc/ranger/examples. #ranger on irc.libera.chat Commands can be typed in by pressing : or added to ~/.config/ranger/rc.conf to apply then wheneverranger starts. All commands are listed in the man page. Some important ones: :shell [<flags>] <command> calls the given <command> with the shell specified in the environmentvariable $SHELL. <flags> can be "-f" to fork the process or "-p" to pipe the output to a pager. Macros like%f and %s are especially useful here. Example: ":shell -f inkscape %f" or ":shell sudo cp %c ./":alias <new> <old> creates the command <new> that calls <old>. The neat thing is that you can passarguments to the next command. Example: ":alias touch shell touch" will allow you to type ":touch FILE",which will be translated to ":shell touch FILE".:map <key> <command> makes the <key> run <command> when pressed. This is the typical way todefine key bindings in rc.conf. There is also "pmap" to define keys in the pager and "unmap" and "punmap"to remove key bindings. INSERT :touch SPACE mark move tofirst element move tolast element move downone page move upone page HOME END PAGE UP PAGE DOWN