-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 25, 2011 at 07:58 PM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `security`
--
-- --------------------------------------------------------
--
-- Table structure for table `roles`
--
CREATE TABLE IF NOT EXISTS `roles` (
`pk_role_id` varchar(50) NOT NULL,
`role_name` varchar(50) NOT NULL,
`created_by` varchar(50) NOT NULL,
`created_datettime` datetime NOT NULL,
`modified_by` varchar(50) NOT NULL,
`modified_datetime` datetime NOT NULL,
PRIMARY KEY (`pk_role_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `roles`
--
INSERT INTO `roles` (`pk_role_id`, `role_name`, `created_by`, `created_datettime`, `modified_by`, `modified_datetime`) VALUES
('psu1001', 'prod_support', 'andrew', '2011-08-20 11:51:58', 'andrew', '2011-08-20 11:52:02'),
('ops1001', 'order pro specialist', 'andrew', '2011-08-20 11:52:51', 'vdsi', '2011-08-20 11:52:55');
-- --------------------------------------------------------
--
-- Table structure for table `role_screen`
--
CREATE TABLE IF NOT EXISTS `role_screen` (
`pk_role_screen_id` varchar(50) NOT NULL,
`fk_role_id` varchar(50) NOT NULL,
`fk_screen_id` varchar(50) NOT NULL,
`created_by` varchar(50) NOT NULL,
`created_datettime` datetime NOT NULL,
`modified_by` varchar(50) NOT NULL,
`modified_datetime` datetime NOT NULL,
PRIMARY KEY (`pk_role_screen_id`),
KEY `fk_role_id` (`fk_role_id`),
KEY `fk_screen_id` (`fk_screen_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `role_screen`
--
INSERT INTO `role_screen` (`pk_role_screen_id`, `fk_role_id`, `fk_screen_id`, `created_by`, `created_datettime`, `modified_by`, `modified_datetime`) VALUES
('1', 'psu1001', 'oes1001', 'andrew', '2011-08-20 12:01:35', 'andrew', '2011-08-20 12:01:40'),
('2', 'psu1001', 'psu1001', 'andrew', '2011-08-20 12:02:11', 'andrew', '2011-08-20 12:02:17'),
('3', 'oes1001', 'oes1001', 'andrew', '2011-08-20 12:03:46', 'andrew', '2011-08-20 12:03:50');
-- --------------------------------------------------------
--
-- Table structure for table `screens`
--
CREATE TABLE IF NOT EXISTS `screens` (
`screen_id` varchar(50) NOT NULL,
`screen_name` varchar(50) NOT NULL,
`created_by` varchar(50) NOT NULL,
`created_datettime` datetime NOT NULL,
`modified_by` varchar(50) NOT NULL,
`modified_datetime` datetime NOT NULL,
PRIMARY KEY (`screen_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `screens`
--
INSERT INTO `screens` (`screen_id`, `screen_name`, `created_by`, `created_datettime`, `modified_by`, `modified_datetime`) VALUES
('oes1001', 'order_entry', 'andew', '2011-08-20 11:56:47', 'andrew', '2011-08-20 11:56:57'),
('pss1001', 'production support', 'andrewq', '2011-08-20 11:58:01', 'andrew', '2011-08-20 11:58:08'),
('1111', 'scree', 'andrew', '2011-08-20 11:56:47', 'andrew', '2011-08-20 11:56:47');
-- --------------------------------------------------------
--
-- Table structure for table `userinfo`
--
CREATE TABLE IF NOT EXISTS `userinfo` (
`pk_user_id` varchar(50) NOT NULL,
`user_name` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`email_id` varchar(50) NOT NULL,
`current_designation` varchar(50) NOT NULL,
`current_role` varchar(50) NOT NULL,
`created_by` varchar(50) NOT NULL,
`created_datettime` datetime NOT NULL,
`modified_by` varchar(50) NOT NULL,
`modified_datetime` datetime NOT NULL,
PRIMARY KEY (`pk_user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `userinfo`
--
INSERT INTO `userinfo` (`pk_user_id`, `user_name`, `password`, `email_id`, `current_designation`, `current_role`, `created_by`, `created_datettime`, `modified_by`, `modified_datetime`) VALUES
('z381466', 'anton', 'anton', 'anton@gmail.com', 'developer', 'developer', 'andrew ', '2011-08-20 11:50:46', 'andrew', '2011-08-20 11:50:46'),
('z381455', 'andrews ', 'andrvdsiews', 'andrew_india@yahoo.com', 'analyst', 'developer', 'vdsi', '2011-08-20 11:49:22', 'andrew', '2011-08-20 11:49:22'),
('oiu', 'oiuo', 'oiu', 'ioou', '98', '9809', '098', '2011-11-11 00:00:00', '890', '2011-11-11 00:00:00');
-- --------------------------------------------------------
--
-- Table structure for table `user_role`
--
CREATE TABLE IF NOT EXISTS `user_role` (
`pk_user_role_id` varchar(50) NOT NULL,
`fk_role_id` varchar(50) NOT NULL,
`fk_user_id` varchar(50) NOT NULL,
`created_by` varchar(50) NOT NULL,
`created_datettime` datetime NOT NULL,
`modified_by` varchar(50) NOT NULL,
`modified_datetime` datetime NOT NULL,
PRIMARY KEY (`pk_user_role_id`),
KEY `fk_role_id` (`fk_role_id`),
KEY `fk_user_id` (`fk_user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_role`
--
INSERT INTO `user_role` (`pk_user_role_id`, `fk_role_id`, `fk_user_id`, `created_by`, `created_datettime`, `modified_by`, `modified_datetime`) VALUES
('1', 'psu1001', 'z381455', 'vdsi', '2011-08-20 11:55:23', 'andrew', '2011-08-20 11:55:33'),
('2', 'ops1001', 'z381455', 'andewq', '2011-08-20 11:55:54', 'vdsi', '2011-08-20 11:55:58');
Thursday, August 25, 2011
Inventory database Design
Hi All Please find a DB Design for inventory and you can use it in your projects.
post questions if youn have any questions or comments.
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 25, 2011 at 07:43 PM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `inventory`
--
-- --------------------------------------------------------
--
-- Table structure for table `branch_info`
--
CREATE TABLE IF NOT EXISTS `branch_info` (
`pk_branch_id` varchar(50) NOT NULL,
`fk_company_id` varchar(50) NOT NULL,
`branch_name` varchar(50) NOT NULL,
`branch_poc` varchar(50) NOT NULL,
`branch_detail` varchar(200) NOT NULL,
`website` varchar(100) NOT NULL,
`created_by` varchar(50) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_branch_id`),
KEY `FK_branch_info_company_info` (`fk_company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `branch_info`
--
-- --------------------------------------------------------
--
-- Table structure for table `company_info`
--
CREATE TABLE IF NOT EXISTS `company_info` (
`pk_company_id` varchar(50) NOT NULL,
`company_name` varchar(50) NOT NULL,
`company_type` varchar(25) NOT NULL,
`company_detail` varchar(100) NOT NULL,
`website` varchar(50) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `company_info`
--
-- --------------------------------------------------------
--
-- Table structure for table `inventory`
--
CREATE TABLE IF NOT EXISTS `inventory` (
`pk_inventory_id` varchar(50) NOT NULL,
`fk_product_id` varchar(50) NOT NULL,
`fk_company_id` varchar(50) NOT NULL,
`fk_branch_id` varchar(50) NOT NULL,
`quantity` int(5) NOT NULL,
`calculation_unit` varchar(4) NOT NULL,
`io_type` varchar(1) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_inventory_id`),
KEY `FK_inventory_product_info` (`fk_product_id`),
KEY `FK_inventory_company_info` (`fk_company_id`),
KEY `FK_inventory_branch_info` (`fk_branch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `inventory`
--
-- --------------------------------------------------------
--
-- Table structure for table `product_info`
--
CREATE TABLE IF NOT EXISTS `product_info` (
`pk_product_id` varchar(50) NOT NULL,
`product_name` varchar(50) NOT NULL,
`product_detail` varchar(100) NOT NULL,
`model` varchar(50) NOT NULL,
`material_type` varchar(50) NOT NULL,
`quantity` int(5) NOT NULL,
`calculation_unit` varchar(4) NOT NULL,
`current_rate` decimal(8,0) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `product_info`
--
-- --------------------------------------------------------
--
-- Table structure for table `product_supplier`
--
CREATE TABLE IF NOT EXISTS `product_supplier` (
`pk_product_supplier_id` varchar(101) NOT NULL,
`fk_product_id` varchar(50) NOT NULL,
`fk_supplier_id` varchar(50) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_product_supplier_id`),
KEY `FK_product_supplier_product_info` (`fk_product_id`),
KEY `FK_product_supplier_supplier_info` (`fk_supplier_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `product_supplier`
--
-- --------------------------------------------------------
--
-- Table structure for table `supplier_info`
--
CREATE TABLE IF NOT EXISTS `supplier_info` (
`pk_supplier_id` varchar(50) NOT NULL,
`supplier_name` varchar(50) NOT NULL,
`supplier_type` varchar(25) NOT NULL,
`supplier_detail` varchar(100) NOT NULL,
`website` varchar(50) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_supplier_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `supplier_info`
--
--
-- Constraints for dumped tables
--
--
-- Constraints for table `branch_info`
--
ALTER TABLE `branch_info`
ADD CONSTRAINT `FK_branch_info_company_info` FOREIGN KEY (`fk_company_id`) REFERENCES `company_info` (`pk_company_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `inventory`
--
ALTER TABLE `inventory`
ADD CONSTRAINT `FK_inventory_branch_info` FOREIGN KEY (`fk_branch_id`) REFERENCES `branch_info` (`pk_branch_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_inventory_company_info` FOREIGN KEY (`fk_company_id`) REFERENCES `company_info` (`pk_company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_inventory_product_info` FOREIGN KEY (`fk_product_id`) REFERENCES `product_info` (`pk_product_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `product_supplier`
--
ALTER TABLE `product_supplier`
ADD CONSTRAINT `FK_product_supplier_product_info` FOREIGN KEY (`fk_product_id`) REFERENCES `product_info` (`pk_product_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_product_supplier_supplier_info` FOREIGN KEY (`fk_supplier_id`) REFERENCES `supplier_info` (`pk_supplier_id`) ON DELETE CASCADE ON UPDATE CASCADE;
post questions if youn have any questions or comments.
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 25, 2011 at 07:43 PM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `inventory`
--
-- --------------------------------------------------------
--
-- Table structure for table `branch_info`
--
CREATE TABLE IF NOT EXISTS `branch_info` (
`pk_branch_id` varchar(50) NOT NULL,
`fk_company_id` varchar(50) NOT NULL,
`branch_name` varchar(50) NOT NULL,
`branch_poc` varchar(50) NOT NULL,
`branch_detail` varchar(200) NOT NULL,
`website` varchar(100) NOT NULL,
`created_by` varchar(50) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_branch_id`),
KEY `FK_branch_info_company_info` (`fk_company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `branch_info`
--
-- --------------------------------------------------------
--
-- Table structure for table `company_info`
--
CREATE TABLE IF NOT EXISTS `company_info` (
`pk_company_id` varchar(50) NOT NULL,
`company_name` varchar(50) NOT NULL,
`company_type` varchar(25) NOT NULL,
`company_detail` varchar(100) NOT NULL,
`website` varchar(50) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `company_info`
--
-- --------------------------------------------------------
--
-- Table structure for table `inventory`
--
CREATE TABLE IF NOT EXISTS `inventory` (
`pk_inventory_id` varchar(50) NOT NULL,
`fk_product_id` varchar(50) NOT NULL,
`fk_company_id` varchar(50) NOT NULL,
`fk_branch_id` varchar(50) NOT NULL,
`quantity` int(5) NOT NULL,
`calculation_unit` varchar(4) NOT NULL,
`io_type` varchar(1) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_inventory_id`),
KEY `FK_inventory_product_info` (`fk_product_id`),
KEY `FK_inventory_company_info` (`fk_company_id`),
KEY `FK_inventory_branch_info` (`fk_branch_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `inventory`
--
-- --------------------------------------------------------
--
-- Table structure for table `product_info`
--
CREATE TABLE IF NOT EXISTS `product_info` (
`pk_product_id` varchar(50) NOT NULL,
`product_name` varchar(50) NOT NULL,
`product_detail` varchar(100) NOT NULL,
`model` varchar(50) NOT NULL,
`material_type` varchar(50) NOT NULL,
`quantity` int(5) NOT NULL,
`calculation_unit` varchar(4) NOT NULL,
`current_rate` decimal(8,0) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `product_info`
--
-- --------------------------------------------------------
--
-- Table structure for table `product_supplier`
--
CREATE TABLE IF NOT EXISTS `product_supplier` (
`pk_product_supplier_id` varchar(101) NOT NULL,
`fk_product_id` varchar(50) NOT NULL,
`fk_supplier_id` varchar(50) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_product_supplier_id`),
KEY `FK_product_supplier_product_info` (`fk_product_id`),
KEY `FK_product_supplier_supplier_info` (`fk_supplier_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `product_supplier`
--
-- --------------------------------------------------------
--
-- Table structure for table `supplier_info`
--
CREATE TABLE IF NOT EXISTS `supplier_info` (
`pk_supplier_id` varchar(50) NOT NULL,
`supplier_name` varchar(50) NOT NULL,
`supplier_type` varchar(25) NOT NULL,
`supplier_detail` varchar(100) NOT NULL,
`website` varchar(50) NOT NULL,
`created_by` varchar(25) NOT NULL,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_updated_by` varchar(50) NOT NULL,
`last_updated_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`status` varchar(1) NOT NULL,
PRIMARY KEY (`pk_supplier_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `supplier_info`
--
--
-- Constraints for dumped tables
--
--
-- Constraints for table `branch_info`
--
ALTER TABLE `branch_info`
ADD CONSTRAINT `FK_branch_info_company_info` FOREIGN KEY (`fk_company_id`) REFERENCES `company_info` (`pk_company_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `inventory`
--
ALTER TABLE `inventory`
ADD CONSTRAINT `FK_inventory_branch_info` FOREIGN KEY (`fk_branch_id`) REFERENCES `branch_info` (`pk_branch_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_inventory_company_info` FOREIGN KEY (`fk_company_id`) REFERENCES `company_info` (`pk_company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_inventory_product_info` FOREIGN KEY (`fk_product_id`) REFERENCES `product_info` (`pk_product_id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `product_supplier`
--
ALTER TABLE `product_supplier`
ADD CONSTRAINT `FK_product_supplier_product_info` FOREIGN KEY (`fk_product_id`) REFERENCES `product_info` (`pk_product_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_product_supplier_supplier_info` FOREIGN KEY (`fk_supplier_id`) REFERENCES `supplier_info` (`pk_supplier_id`) ON DELETE CASCADE ON UPDATE CASCADE;
Wednesday, August 17, 2011
PHP TUTOR
What is PHP?
PHP is one of the langauge for Web Programming.
It is used to develop dynamic web sites like Online shopping, Exam results and railway reservation.
What is Know as Dynamic web Pages and static web Page? (Basic)
Dyanmic Web Site :
Web Page Content is taken and displayed from database, It is Dynamic Content.
Example : Exam Results. Here student info and marks are taken from database.
Static Web Site :
In web Page, Content is entered in web page it self is known as static content.
Example : About us, Contact us pages in web site.
What is Database commonly used for PHP and WHY? (Basic)
MYSQL because it is open source.
PHP is one of the langauge for Web Programming.
It is used to develop dynamic web sites like Online shopping, Exam results and railway reservation.
What is Know as Dynamic web Pages and static web Page? (Basic)
Dyanmic Web Site :
Web Page Content is taken and displayed from database, It is Dynamic Content.
Example : Exam Results. Here student info and marks are taken from database.
Static Web Site :
In web Page, Content is entered in web page it self is known as static content.
Example : About us, Contact us pages in web site.
What is Database commonly used for PHP and WHY? (Basic)
MYSQL because it is open source.
Subscribe to:
Posts (Atom)