Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Basic Help With SQL Statement


jond
 Share

Recommended Posts

Hi,

 

Im installing the Discount Groups mod. This is the SQL i need, as per the instructions:

 

# Database: catalog

# Table: 'customers_groups'

#

CREATE TABLE `customers_groups` (

`customers_groups_id` int(11) NOT NULL auto_increment,

`customers_groups_name` varchar(32) NOT NULL default '',

`customers_groups_discount` int(11) NOT NULL default '0',

PRIMARY KEY (`customers_groups_id`)

) TYPE=MyISAM;

 

# Database: catalog

# Table: 'groups_to_categories'

#

CREATE TABLE `groups_to_categories` (

`customers_groups_id` int(11) NOT NULL default '0',

`categories_id` int(11) NOT NULL default '0',

`discount` int(11) NOT NULL default '0',

PRIMARY KEY (`customers_groups_id`,`categories_id`)

) TYPE=MyISAM; F

 

add to the "customers_groups" table a record with id "1", name "Default" and discount = 0

 

add the column "customers_groups_id" int(11) to "customers" table with default value = 1;

 

execute on table "customers":

UPDATE customers SET customers_groups_id = 1;

 

add the column "category_id" int(11) to "customers_basket" table ;

 

----------------------------------------------

Could someone translate this into pure SQL for me?

Thanks in advance!

Link to comment
Share on other sites

  • 2 weeks later...
add to the "customers_groups" table a record with id "1", name "Default" and discount = 0

 

add the column "customers_groups_id" int(11) to "customers" table with default value = 1;

 

execute on table "customers":

UPDATE customers SET customers_groups_id = 1;

 

add the column "category_id" int(11) to  "customers_basket" table ;

 

----------------------------------------------

Could someone translate this into pure SQL for me?

Thanks in advance!

 

Insert into customers_groups (id,name,discount)

values

('1','Default',0);

 

Alter table customers_groups_id

add 'customers_groups_id' int(11) with default = 1;

 

Update customers

set customers_groups_id = 1;

 

Alter table 'customers_basket'

add 'category_id int(11);

 

This is standard SQL, not sure where the quotes go, or if they should be single or double quotes. But this should get you closer. :thumbsup:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...