Recent programs

code

an anonymous user · April 17, 2021 · Python
for i in range(0, 5):
    if i % 2 == 0:
        if i == 2:
            continue
        print(i, end="")

LeetCodeMedium

an anonymous user · April 17, 2021 · C++
#include <iostream>
using namespace std;

class Node{
    public:
    int data;
    Node *next;
};

void append(Node** head_ref, int new_data) 
{ 

Student

an anonymous user · April 17, 2021 · SQL
-- create a table
CREATE TABLE students (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  gender TEXT NOT NULL
);
-- insert some values
INSERT INTO students VALUES (1, 'Ryan', 'M');
INSERT INTO students VALUES (2, 'Joanna', 'F');
-- fetch some values
SELECT * FROM students WHERE gender = 'F';

sql3.sql

an anonymous user · April 17, 2021 · SQL
create table emp
(
name varchar(8000),
salary bigint
);
insert into emp values('rohith', 40000);
insert into emp values('brrahman', 10000);
insert into emp values('a', 30000);
insert into emp values('komal', 60000);
insert into emp values('roshak', 75000);
insert into emp values('karthick', 20000);

sql3.sql

an anonymous user · April 17, 2021 · SQL
create table emp
(
name varchar(8000),
salary bigint
);
insert into emp values('rohith', 40000);
insert into emp values('brrahman', 10000);
insert into emp values('a', 30000);
insert into emp values('komal', 60000);
insert into emp values('roshak', 75000);
insert into emp values('karthick', 20000);

Ddl

an anonymous user · April 17, 2021 · SQL
create table student(id int, name varchar(20),marks int);
insert into student values(1,"raju",30);
insert into student values(2, "somu",45);
insert into  student values(3, "ramesh",57);
select*from student;
select id from student;
select *from student where marks>30;
alter table student add dob date;
insert into student(dob)values(24082020);
select*from student;

Ddl

an anonymous user · April 17, 2021 · SQL
create table student(id int, name varchar(20),marks int);
insert into student values(1,"raju",30);
insert into student values(2, "somu",45);
insert into  student values(3, "ramesh",57);
select*from student;
select id from student;
select *from student where marks>30;
alter table student add dob date;
insert into student(dob)values(24082020);
select*from student;
drop column dob from student;

Demo

an anonymous user · April 17, 2021 · SQL
CREATE TABLE  "AGENTS" 
   (	
    "AGENT_CODE" CHAR(6) NOT NULL PRIMARY KEY, 
	"AGENT_NAME" CHAR(40), 
	"WORKING_AREA" CHAR(35), 
	"COMMISSION" NUMBER(10,2), 
	"PHONE_NO" CHAR(15), 
	"COUNTRY" VARCHAR2(25) 
	 );
INSERT INTO AGENTS VALUES ('A007', 'Ramasundar', 'Bangalore', '0.15', '077-25814763', '');
INSERT INTO AGENTS VALUES ('A003', 'Alex ', 'London', '0.13', '075-12458969', '');

Student

an anonymous user · April 17, 2021 · SQL
-- create a table
CREATE TABLE students (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  gender TEXT NOT NULL,
  marks INTEGER NOT NULL,
  dept TEXT NOT NULL
);
-- insert some values
INSERT INTO students VALUES (1, 'Ryan', 'M',85,'CS');
INSERT INTO students VALUES (2, 'Joanna', 'F',95,'EC');

g

an anonymous user · April 17, 2021 · SQL
CREATE TABLE DEPOSIT (ACTNO VARCHAR2(5) ,CNAME VARCHAR2(18) , BNAME VARCHAR2(18) , AMOUNT NUMBER(8,2) ,ADATE DATE);
CREATE TABLE BRANCH(BNAME VARCHAR2(18),CITY VARCHAR2(18));
CREATE TABLE CUSTOMERS(CNAME VARCHAR2(19) ,CITY VARCHAR2(18));
CREATE TABLE BORROW(LOANNO VARCHAR2(5), CNAME VARCHAR2(18), BNAME VARCHAR2(18), AMOUNT NUMBER (8,2));

g

an anonymous user · April 17, 2021 · SQL
CREATE TABLE DEPOSIT (ACTNO VARCHAR2(5) ,CNAME VARCHAR2(18) , BNAME VARCHAR2(18) , AMOUNT NUMBER(8,2) ,ADATE DATE);
CREATE TABLE BRANCH(BNAME VARCHAR2(18),CITY VARCHAR2(18));
CREATE TABLE CUSTOMERS(CNAME VARCHAR2(19) ,CITY VARCHAR2(18));
CREATE TABLE BORROW(LOANNO VARCHAR2(5), CNAME VARCHAR2(18), BNAME VARCHAR2(18), AMOUNT NUMBER (8,2));

SUPPLIER

an anonymous user · April 17, 2021 · SQL
-- create a table
CREATE TABLE SUPPLIER (
  id varchar2(10),
  name TEXT NOT NULL,
  CITY TEXT NOT NULL
);
INSERT INTO students VALUES (1, 'Ryan', 'M');
INSERT INTO students VALUES (2, 'Joanna', 'F');

ddl

an anonymous user · April 17, 2021 · SQL
create table emp(empno number(4)primary key,ename char(10));

Tabke

an anonymous user · April 17, 2021 · SQL
-- create a table
CREATE TABLE employee (
  emp_id number PRIMARY KEY,
  emp_name TEXT NOT NULL,
  managerid number
);
-- insert some values
INSERT INTO employee VALUES (1, 'A', 2);
INSERT INTO employee VALUES (2, 'B', 4);
insert into employee values (4,'C',5);
insert into employee values (5,'D',NULL);

Temp

an anonymous user · April 17, 2021 · R
x <- seq(-pi, pi, 0.1)
plot(x, cos(x))
%macro read 2
mov Rax, 0
mov Rdi, 0
mov Rsi, %1
mov Rdx, %2
syscall
%endmacro

%macro print 2
mov Rax, 1
mov Rdi, 1

for loop

atharvathakur · April 17, 2021 · C#
using System;

namespace Loops {
   class Program {
      static void Main(string[] args) {
         
        for (int i = 1; i <=5; i++) {
            Console.WriteLine("value of i: {0}", i);
         }
         Console.ReadLine();
      }

teacher_students

an anonymous user · April 17, 2021 · SQL
-- create a table
CREATE TABLE students (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  age INTEGER NOT NULL
);

CREATE TABLE teachers (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  age INTEGER NOT NULL

Listtables

an anonymous user · April 17, 2021 · SQL
CREATE TABLE  "AGENTS" 
   (	
    "AGENT_CODE" CHAR(6) NOT NULL PRIMARY KEY, 
	"AGENT_NAME" CHAR(40), 
	"WORKING_AREA" CHAR(35), 
	"COMMISSION" NUMBER(10,2), 
	"PHONE_NO" CHAR(15), 
	"COUNTRY" VARCHAR2(25) 
	 );
INSERT INTO AGENTS VALUES ('A007', 'Ramasundar', 'Bangalore', '0.15', '077-25814763', '');
INSERT INTO AGENTS VALUES ('A003', 'Alex ', 'London', '0.13', '075-12458969', '');

My table

an anonymous user · April 17, 2021 · SQL
-- create a table
CREATE TABLE students (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  gender TEXT NOT NULL
);
-- insert some values
INSERT INTO students VALUES (1, 'Ryan', 'M');
INSERT INTO students VALUES (2, 'Joanna', 'F');
-- fetch some values
SELECT * FROM students WHERE gender = 'F';